|
|
@@ -0,0 +1,18 @@
|
|
|
+package cn.seecoder.seecoderportalserver.web.rest;
|
|
|
+
|
|
|
+import org.junit.jupiter.api.Test;
|
|
|
+
|
|
|
+import java.util.regex.Pattern;
|
|
|
+
|
|
|
+import static org.junit.jupiter.api.Assertions.*;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author kunduin
|
|
|
+ */
|
|
|
+class AuthControllerTest {
|
|
|
+ @Test
|
|
|
+ public void matchTest() {
|
|
|
+ assertTrue(Pattern.matches(".*(([\\w.]*\\.seecoder\\.cn)|(localhost:\\d+)).*", "http://localhost:3000"));
|
|
|
+ assertFalse(Pattern.matches(".*(([\\w.]*\\.seecoder\\.cn)|(localhost:\\d+)).*", "http://a:3000"));
|
|
|
+ }
|
|
|
+}
|