use of org.springframework.data.keyvalue.Person in project spring-data-keyvalue by spring-projects.
the class AbstractRepositoryUnitTests method findsByValueInCollectionCorrectlyWhenTargetPathAndCollectionContainNullValue.
// DATAKV-169
@Test
public void findsByValueInCollectionCorrectlyWhenTargetPathAndCollectionContainNullValue() {
repository.saveAll(LENNISTERS);
Person personWithNullAsFirstname = new Person(null, 10);
repository.save(personWithNullAsFirstname);
List<Person> result = repository.findByFirstnameIn(Arrays.asList(CERSEI.getFirstname(), JAIME.getFirstname(), null));
assertThat(result, hasSize(3));
assertThat(result, is(containsInAnyOrder(CERSEI, JAIME, personWithNullAsFirstname)));
}
use of org.springframework.data.keyvalue.Person in project spring-data-keyvalue by spring-projects.
the class AbstractRepositoryUnitTests method findsByValueInCollectionCorrectlyWhenTargetPathContainsNullValue.
// DATAKV-169
@Test
public void findsByValueInCollectionCorrectlyWhenTargetPathContainsNullValue() {
repository.saveAll(LENNISTERS);
repository.save(new Person(null, 10));
List<Person> result = repository.findByFirstnameIn(Arrays.asList(CERSEI.getFirstname(), JAIME.getFirstname()));
assertThat(result, hasSize(2));
assertThat(result, is(containsInAnyOrder(CERSEI, JAIME)));
}
use of org.springframework.data.keyvalue.Person in project spring-data-keyvalue by spring-projects.
the class QuerydslKeyValueRepositoryUnitTests method findAllWithOrderSpecifierWorksCorrectly.
// DATAKV-90
@Test
public void findAllWithOrderSpecifierWorksCorrectly() {
repository.saveAll(LENNISTERS);
Iterable<Person> result = repository.findAll(new QSort(QPerson.person.firstname.desc()));
assertThat(result, contains(TYRION, JAIME, CERSEI));
}