Skip to content

Commit

Permalink
refactor: code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
bsbodden committed May 2, 2024
1 parent b0b392b commit 523676f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public JedisConnectionFactory jedisConnectionFactory() {

final JedisPoolConfig poolConfig = new JedisPoolConfig();
poolConfig.setTestWhileIdle(false);
poolConfig.setMinEvictableIdleTime(Duration.ofMillis(60000));
poolConfig.setMinEvictableIdleDuration(Duration.ofMillis(60000));
poolConfig.setTimeBetweenEvictionRuns(Duration.ofMillis(30000));
poolConfig.setNumTestsPerEvictionRun(-1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class RedisHashVSSIndexCreationTest extends AbstractBaseEnhancedRedisTest {

private UnifiedJedis jedis;

private static String INDEX = "com.redis.om.spring.annotations.hash.fixtures.HashWithVectorsIdx";
private static final String INDEX = "com.redis.om.spring.annotations.hash.fixtures.HashWithVectorsIdx";
private HashWithVectors hwv1;
private HashWithVectors hwv2;
private HashWithVectors hwv3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ void testHashDeserializationUsingCustomFinder() {

@Test
void testLocalDateDeSerializationInQuery() {
List<KitchenSink> all = repository.findByLocalDateGreaterThan(localDate.minus(2, ChronoUnit.DAYS));
List<KitchenSink> all = repository.findByLocalDateGreaterThan(localDate.minusDays(2));
assertThat(all).containsExactlyInAnyOrder(ks, ks1, ks2, ks3, ks4);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ void testFreeFormTextSearchOrderIssue() {
.filter(Doc2$.TEXT.endsWith("o 11")) //
.collect(Collectors.toList());

String regex = ".*o\s11$";
String regex = ".*o 11$";
assertThat(startingWithMarca2).map(Doc2::getText).allMatch(t -> t.matches(regex));
}

Expand All @@ -247,13 +247,13 @@ void testFreeFormTextSearchOrderIssue() {
.filter(Doc2$.TAG.endsWith("LOR 12")) //
.collect(Collectors.toList());

String regex = ".*LOR\s12$";
String regex = ".*LOR 12$";
assertThat(startingWithMarca2).map(Doc2::getTag).allMatch(t -> t.matches(regex));
}

@Test void testSearchInsideListOfObjects() {
var results = entityStream.of(DeepList.class) //
.filter(DeepList$.NEST_LEVELS.NAME.eq("nl-2-2")) //
.filter(DeepList_nestLevels$.NAME.eq("nl-2-2")) //
.map(DeepList$.NAME) //
.collect(Collectors.toList());

Expand All @@ -265,7 +265,7 @@ void testFreeFormTextSearchOrderIssue() {

@Test void testSearchInsideListOfObjects2() {
var results = entityStream.of(DeepList.class) //
.filter(DeepList$.NEST_LEVELS.NAME.startsWith("nl-2")) //
.filter(DeepList_nestLevels$.NAME.startsWith("nl-2")) //
.map(DeepList$.NAME) //
.collect(Collectors.toList());

Expand All @@ -277,7 +277,7 @@ void testFreeFormTextSearchOrderIssue() {

@Test void testSearchInsideListOfObjects3() {
var results = entityStream.of(DeepList.class) //
.filter(DeepList$.NEST_LEVELS.BLOCK.eq("have")) //
.filter(DeepList_nestLevels$.BLOCK.eq("have")) //
.map(DeepList$.NAME) //
.collect(Collectors.toList());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ public void testInvalidStartCharacter() {
@Test
public void testInvalidPartCharacter() {
String result = ObjectUtils.replaceIfIllegalJavaIdentifierCharacter("invalid*identifier");
assertThat(result).isEqualTo("invalid" + ObjectUtils.REPLACEMENT_CHARACTER.toString() + "identifier");
assertThat(result).isEqualTo("invalid" + ObjectUtils.REPLACEMENT_CHARACTER + "identifier");
}

@Test
Expand Down

0 comments on commit 523676f

Please sign in to comment.