Functional PathPattern comparator

This commit is contained in:
Rossen Stoyanchev
2017-08-14 16:32:40 +03:00
parent ef175d7ca6
commit 8c4b1ab781
2 changed files with 22 additions and 44 deletions

View File

@@ -967,10 +967,10 @@ public class PathPatternTests {
}
@Test
public void patternCompareToNull() {
PathPatternParser p = new PathPatternParser();
PathPattern pp = p.parse("/abc");
assertEquals(-1, pp.compareTo(null));
public void patternCompareWithNull() {
assertTrue(PathPattern.SPECIFICITY_COMPARATOR.compare(null, null) == 0);
assertTrue(PathPattern.SPECIFICITY_COMPARATOR.compare(parse("/abc"), null) < 0);
assertTrue(PathPattern.SPECIFICITY_COMPARATOR.compare(null, parse("/abc")) > 0);
}
@Test