DATAREDIS-771 - Polishing.
Add test and update documentation. Original Pull Request: #342
This commit is contained in:
@@ -696,7 +696,9 @@ The following table provides an overview of the keywords supported for Redis and
|
||||
|Keyword|Sample|Redis snippet
|
||||
|`And`|`findByLastnameAndFirstname`|`SINTER …:firstname:rand …:lastname:al’thor`
|
||||
|`Or`|`findByLastnameOrFirstname`|`SUNION …:firstname:rand …:lastname:al’thor`
|
||||
|`Is,Equals`|`findByFirstname`,`findByFirstnameIs`,`findByFirstnameEquals`|`SINTER …:firstname:rand`
|
||||
|`Is, Equals`|`findByFirstname`, `findByFirstnameIs`, `findByFirstnameEquals`|`SINTER …:firstname:rand`
|
||||
|`IsTrue` | `FindByAliveIsTrue` | `SINTER …:alive:1`
|
||||
|`IsFalse` | `findByAliveIsFalse` | `SINTER …:alive:0`
|
||||
|`Top,First`|`findFirst10ByFirstname`,`findTop5ByFirstname`|
|
||||
|===============
|
||||
====
|
||||
|
||||
@@ -232,6 +232,7 @@ public abstract class RedisRepositoryIntegrationTestBase {
|
||||
|
||||
Person robb = new Person("robb", "stark");
|
||||
robb.setAlive(false);
|
||||
|
||||
Person jon = new Person("jon", "snow");
|
||||
|
||||
repo.saveAll(Arrays.asList(eddard, robb, jon));
|
||||
@@ -242,6 +243,25 @@ public abstract class RedisRepositoryIntegrationTestBase {
|
||||
assertThat(result, contains(eddard));
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-771
|
||||
public void shouldFindByBooleanIsFalse() {
|
||||
|
||||
Person eddard = new Person("eddard", "stark");
|
||||
eddard.setAlive(true);
|
||||
|
||||
Person robb = new Person("robb", "stark");
|
||||
robb.setAlive(false);
|
||||
|
||||
Person jon = new Person("jon", "snow");
|
||||
|
||||
repo.saveAll(Arrays.asList(eddard, robb, jon));
|
||||
|
||||
List<Person> result = repo.findPersonByAliveIsFalse();
|
||||
|
||||
assertThat(result, hasSize(1));
|
||||
assertThat(result, contains(robb));
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-547
|
||||
public void shouldReturnEmptyListWhenPageableOutOfBoundsUsingFindAll() {
|
||||
|
||||
@@ -394,6 +414,8 @@ public abstract class RedisRepositoryIntegrationTestBase {
|
||||
|
||||
List<Person> findPersonByAliveIsTrue();
|
||||
|
||||
List<Person> findPersonByAliveIsFalse();
|
||||
|
||||
List<Person> findByFirstnameAndLastname(String firstname, String lastname);
|
||||
|
||||
List<Person> findByFirstnameOrLastname(String firstname, String lastname);
|
||||
|
||||
@@ -57,6 +57,7 @@ public class RedisRepositoryIntegrationTests extends RedisRepositoryIntegrationT
|
||||
keyspaceConfiguration = MyKeyspaceConfiguration.class,
|
||||
includeFilters = { @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE,
|
||||
classes = { PersonRepository.class, CityRepository.class }) })
|
||||
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
|
||||
Reference in New Issue
Block a user