/** * @see #153 */ @Test public void substringMatching() { Example<User> example = Example.of(new User("er", null, null), matching().// withStringMatcher(StringMatcher.ENDING)); assertThat(repository.findAll(example), hasItems(skyler, walter)); }
/** * @see #153 */ @Test public void substringMatching() { Example<Person> example = Example.of(new Person("er", null, null), matching().// withStringMatcher(StringMatcher.ENDING)); assertThat(repository.findAll(example), hasItems(skyler, walter)); }
/** * @see #153 */ @Test public void substringMatching() { Example<Person> example = Example.of(new Person("er", null, null), matching().// withStringMatcher(StringMatcher.ENDING)); assertThat(operations.find(query(byExample(example)), Person.class), hasItems(skyler, walter)); }
/** * @see #153 */ @Test public void findAllPersonsBySimpleExample() { Example<Person> example = Example.of(new Person(".*", null, null), // matching().withStringMatcher(StringMatcher.REGEX)); assertThat(userRepository.findAll(example), containsInAnyOrder(skyler, walter, flynn)); assertThat(userRepository.findAll(example), not(containsInAnyOrder(hank, marie))); }
/** * @see #153 */ @Test public void findAllRelativesBySimpleExample() { Example<Relative> example = Example.of(new Relative(".*", null, null), // matching().withStringMatcher(StringMatcher.REGEX)); assertThat(contactRepository.findAll(example), containsInAnyOrder(hank, marie)); assertThat(contactRepository.findAll(example), not(containsInAnyOrder(skyler, walter, flynn))); }
@Test public void substringMatching() { Example<User> example = Example.of(new User("er", null, null), matching().// withStringMatcher(StringMatcher.ENDING)); assertThat(repository.findAll(example), hasItems(skyler, walter)); }
@Test public void substringMatching() { Example<Person> example = Example.of(new Person("er", null, null), matching().// withStringMatcher(StringMatcher.ENDING)); assertThat(repository.findAll(example), hasItems(skyler, walter)); }
/** * create an example filter with the default matcher (ignore case and match strings with CONTAINING) * * @param probe Probe to filter by */ public ExampleFilter(T probe) { this(probe, ExampleMatcher.matching().withIgnoreCase().withStringMatcher(StringMatcher.CONTAINING)); }