Я столкнулся с этим странным поведением из AntPathMatcher , которое я выделил в модульном тесте ниже:
@Test
public void testAntPathMacherPotentiallyBrokenForNix() throws IOException {
AntPathMatcher antPathMatcher = new AntPathMatcher();
Resource resource = new ClassPathResource("properties/RESOURCE_TEST.properties"); // there's a RESOURCE_TEST.properties under a directory 'properties'
String localPath = resource.getFile().getAbsolutePath();
Assert.assertThat(antPathMatcher.match("*.properties", localPath), is(true));
String nixPath = "/local/app/instances/properties/RESOURCE_TEST.properties";
Assert.assertThat(antPathMatcher.match("*.properties", nixPath), is(true));
}
2-е утверждение не выполняется, но не должны ли оба утверждения выше быть верными?
Чего мне не хватает? (не то чтобы я действительно использовал AntPathMatcher, мне просто любопытно)