package org.apereo.cas.util;

import lombok.val;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

/**
 * Tests for {@link RegexUtils}
 *
 * @author David Rodriguez
 * @since 5.1.0
 */
public class RegexUtilsTests {

    @Test
    public void verifyNotValidRegex() {
        val notValidRegex = "***";

        assertFalse(RegexUtils.isValidRegex(notValidRegex));
    }

    @Test
    public void verifyNullRegex() {
        assertFalse(RegexUtils.isValidRegex(null));
    }
}

@@ -42,16 +42,61 @@
 ok.val;%0A
+import org.apache.commons.lang3.StringUtils;%0A
 import o
@@ -377,17 +377,16 @@
  %22***%22;%0A
-%0A
         
@@ -445,16 +445,239 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void verifyBlankValidRegex() %7B%0A        val pattern = RegexUtils.createPattern(StringUtils.EMPTY);%0A        assertNotNull(pattern);%0A        assertEquals(RegexUtils.MATCH_NOTHING_PATTERN, pattern);%0A    %7D%0A%0A
     @Tes

add test for regex patterns being empty