blob: bb737ba980595a16ccbc9d61ad53905be62ece63 [file] [log] [blame]
package org.apache.servicecomb.authentication.test;
import java.util.regex.Pattern;
import org.junit.Assert;
import org.junit.Test;
public class PatternTest {
@Test
public void testPattern() {
String regex = "(/v1/log|/inspector|/v1/auth)/(.*)";
Pattern p = Pattern.compile(regex);
Assert.assertTrue(p.matcher("/v1/log/login").matches());
Assert.assertTrue(p.matcher("/inspector/login").matches());
Assert.assertTrue(p.matcher("/v1/auth/login").matches());
Assert.assertTrue(!p.matcher("/api/v1/auth/login").matches());
}
}