DATACMNS-953 - Fixed application of GenericPropertyMatchers.exact().
We now really use exact matching for a match setup requesting exact matching. Previously, we erroneously set up the matching with a startsWith().
This commit is contained in:
@@ -608,7 +608,7 @@ public class ExampleMatcher {
|
||||
* @return
|
||||
*/
|
||||
public static GenericPropertyMatcher exact() {
|
||||
return new GenericPropertyMatcher().startsWith();
|
||||
return new GenericPropertyMatcher().exact();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,7 +38,6 @@ import org.springframework.data.domain.ExampleMatcher.StringMatcher;
|
||||
* @author Mark Paluch
|
||||
* @soundtrack Ron Spielman Trio - Fretboard Highway (Electric Tales)
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class ExampleSpecificationAccessorUnitTests {
|
||||
|
||||
Person person;
|
||||
@@ -322,6 +321,19 @@ public class ExampleSpecificationAccessorUnitTests {
|
||||
assertThat(exampleSpecificationAccessor.hasPropertySpecifiers(), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACMNS-953
|
||||
*/
|
||||
@Test
|
||||
public void exactMatcherUsesExactMatching() {
|
||||
|
||||
ExampleMatcher matcher = ExampleMatcher.matching()//
|
||||
.withMatcher("firstname", exact());
|
||||
|
||||
assertThat(new ExampleMatcherAccessor(matcher).getPropertySpecifier("firstname").getStringMatcher(),
|
||||
is(StringMatcher.EXACT));
|
||||
}
|
||||
|
||||
static class Person {
|
||||
String firstname;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user