diff --git a/src/test/java/net/kaczmarzyk/spring/data/jpa/domain/InIgnoreCaseTest.java b/src/test/java/net/kaczmarzyk/spring/data/jpa/domain/InIgnoreCaseTest.java index 9c79b11a..ba0b93dd 100644 --- a/src/test/java/net/kaczmarzyk/spring/data/jpa/domain/InIgnoreCaseTest.java +++ b/src/test/java/net/kaczmarzyk/spring/data/jpa/domain/InIgnoreCaseTest.java @@ -110,8 +110,8 @@ public void filtersByStringCaseInsensitive() { .hasSize(2) .containsOnly(homerSimpson, margeSimpson); - InIgnoreCase firstNameWithO = inIgnoreCaseSpec("firstName", new String[]{"moe", "HOMER"}); - result = customerRepo.findAll(firstNameWithO); + InIgnoreCase firstNameMoeOrHomer = inIgnoreCaseSpec("firstName", new String[]{"moe", "HOMER"}); + result = customerRepo.findAll(firstNameMoeOrHomer); assertThat(result) .hasSize(2) .containsOnly(homerSimpson, moeSzyslak); diff --git a/src/test/java/net/kaczmarzyk/spring/data/jpa/domain/NotInIgnoreCaseTest.java b/src/test/java/net/kaczmarzyk/spring/data/jpa/domain/NotInIgnoreCaseTest.java index 3b15e6ae..77ae1783 100644 --- a/src/test/java/net/kaczmarzyk/spring/data/jpa/domain/NotInIgnoreCaseTest.java +++ b/src/test/java/net/kaczmarzyk/spring/data/jpa/domain/NotInIgnoreCaseTest.java @@ -55,42 +55,42 @@ public void initData() { @Test public void filtersByEnumValueCaseInsensitive_singleValue() { - NotInIgnoreCase genderMale = notInIgnoreCaseSpec("gender", new String[]{"male"}); - List males = customerRepo.findAll(genderMale); - assertThat(males).hasSize(2).containsOnly(margeSimpson, joeQuimby); + NotInIgnoreCase genderNotMale = notInIgnoreCaseSpec("gender", new String[]{"male"}); + List nonMales = customerRepo.findAll(genderNotMale); + assertThat(nonMales).hasSize(2).containsOnly(margeSimpson, joeQuimby); - NotInIgnoreCase genderFemale = notInIgnoreCaseSpec("gender", new String[]{"feMALE"}); - List females = customerRepo.findAll(genderFemale); - assertThat(females).hasSize(3).containsOnly(homerSimpson, moeSzyslak, joeQuimby); + NotInIgnoreCase genderNotFemale = notInIgnoreCaseSpec("gender", new String[]{"feMALE"}); + List nonFemales = customerRepo.findAll(genderNotFemale); + assertThat(nonFemales).hasSize(3).containsOnly(homerSimpson, moeSzyslak, joeQuimby); - NotInIgnoreCase genderOther = notInIgnoreCaseSpec("gender", new String[]{"OtHeR"}); - List others = customerRepo.findAll(genderOther); - assertThat(others).hasSize(3).containsOnly(homerSimpson, margeSimpson, moeSzyslak); + NotInIgnoreCase genderNotOther = notInIgnoreCaseSpec("gender", new String[]{"OtHeR"}); + List malesAndFemales = customerRepo.findAll(genderNotOther); + assertThat(malesAndFemales).hasSize(3).containsOnly(homerSimpson, margeSimpson, moeSzyslak); } @Test public void filtersByEnumValueCaseInsensitive_multiValue() { - NotInIgnoreCase genderMaleOrFemale = notInIgnoreCaseSpec("gender", new String[]{"male", "feMALE"}); - List malesOrFemales = customerRepo.findAll(genderMaleOrFemale); - assertThat(malesOrFemales).hasSize(1).containsOnly(joeQuimby); + NotInIgnoreCase genderNotMaleOrFemale = notInIgnoreCaseSpec("gender", new String[]{"male", "feMALE"}); + List others = customerRepo.findAll(genderNotMaleOrFemale); + assertThat(others).hasSize(1).containsOnly(joeQuimby); } @Test public void filtersByLongValue() { - NotInIgnoreCase simpsonsIds = notInIgnoreCaseSpec("id", new String[]{homerSimpson.getId().toString(), margeSimpson.getId().toString()}); + NotInIgnoreCase notInSimpsonsIds = notInIgnoreCaseSpec("id", new String[]{homerSimpson.getId().toString(), margeSimpson.getId().toString()}); - List simpsons = customerRepo.findAll(simpsonsIds); + List notSimpsons = customerRepo.findAll(notInSimpsonsIds); - assertThat(simpsons).hasSize(2).containsOnly(moeSzyslak, joeQuimby); + assertThat(notSimpsons).hasSize(2).containsOnly(moeSzyslak, joeQuimby); } @Test public void filtersByLongValue_withAdditionalNonExistingValue() { - NotInIgnoreCase simpsonsIdsWithTrash = notInIgnoreCaseSpec("id", new String[]{"12345", homerSimpson.getId().toString(), margeSimpson.getId().toString()}); + NotInIgnoreCase notInSimpsonsIdsWithTrash = notInIgnoreCaseSpec("id", new String[]{"12345", homerSimpson.getId().toString(), margeSimpson.getId().toString()}); - List simpsons = customerRepo.findAll(simpsonsIdsWithTrash); + List notSimpsons = customerRepo.findAll(notInSimpsonsIdsWithTrash); - assertThat(simpsons).hasSize(2).containsOnly(moeSzyslak, joeQuimby); + assertThat(notSimpsons).hasSize(2).containsOnly(moeSzyslak, joeQuimby); } @Test @@ -104,14 +104,14 @@ public void filtersByIntegerValue() { @Test public void filtersByStringCaseInsensitive() { - NotInIgnoreCase lastNameSimpson = notInIgnoreCaseSpec("lastName", "sIMPSOn"); - List result = customerRepo.findAll(lastNameSimpson); + NotInIgnoreCase lastNameNotSimpson = notInIgnoreCaseSpec("lastName", "sIMPSOn"); + List result = customerRepo.findAll(lastNameNotSimpson); assertThat(result) .hasSize(2) .containsOnly(moeSzyslak, joeQuimby); - NotInIgnoreCase firstNameWithO = notInIgnoreCaseSpec("firstName", new String[]{"moe", "HOMER"}); - result = customerRepo.findAll(firstNameWithO); + NotInIgnoreCase firstNameNotMoeOrHomer = notInIgnoreCaseSpec("firstName", new String[]{"moe", "HOMER"}); + result = customerRepo.findAll(firstNameNotMoeOrHomer); assertThat(result) .hasSize(2) .containsOnly(margeSimpson, joeQuimby); @@ -119,30 +119,30 @@ public void filtersByStringCaseInsensitive() { @Test public void filtersByDateWithDefaultDateFormat() { - NotInIgnoreCase registered1stMarch = notInIgnoreCaseSpec("registrationDate", new String[]{"2015-03-02"}); - List found = customerRepo.findAll(registered1stMarch); + NotInIgnoreCase notRegistered2ndMarch = notInIgnoreCaseSpec("registrationDate", new String[]{"2015-03-02"}); + List found = customerRepo.findAll(notRegistered2ndMarch); assertThat(found).hasSize(2).containsOnly(homerSimpson, margeSimpson); - NotInIgnoreCase registered1stOr2ndMarch = notInIgnoreCaseSpec("registrationDate", new String[]{"2015-03-02", "2015-03-01"}); - found = customerRepo.findAll(registered1stOr2ndMarch); + NotInIgnoreCase notRegistered1stOr2ndMarch = notInIgnoreCaseSpec("registrationDate", new String[]{"2015-03-02", "2015-03-01"}); + found = customerRepo.findAll(notRegistered1stOr2ndMarch); assertThat(found).hasSize(0); } @Test public void filterByDateWithCustomDateFormat() { - InIgnoreCase registered1stMarch = notInIgnoreCaseSpec("registrationDate", new String[]{"02-03-2015"}, + InIgnoreCase notRegistered2ndMarch = notInIgnoreCaseSpec("registrationDate", new String[]{"02-03-2015"}, Converter.withDateFormat("dd-MM-yyyy", OnTypeMismatch.EMPTY_RESULT, null)); - List found = customerRepo.findAll(registered1stMarch); + List found = customerRepo.findAll(notRegistered2ndMarch); assertThat(found).hasSize(2).containsOnly(homerSimpson, margeSimpson); - NotInIgnoreCase registered1stOr2ndMarch = notInIgnoreCaseSpec("registrationDate", new String[]{"01-03-2015", "02-03-2015"}, + NotInIgnoreCase notRegistered1stOr2ndMarch = notInIgnoreCaseSpec("registrationDate", new String[]{"01-03-2015", "02-03-2015"}, Converter.withDateFormat("dd-MM-yyyy", OnTypeMismatch.EMPTY_RESULT, null)); - found = customerRepo.findAll(registered1stOr2ndMarch); + found = customerRepo.findAll(notRegistered1stOr2ndMarch); assertThat(found).hasSize(0); }