diff --git a/apps/opik-backend/src/main/java/com/comet/opik/infrastructure/RedisConfig.java b/apps/opik-backend/src/main/java/com/comet/opik/infrastructure/RedisConfig.java index f91e4ae44f..eaa21ea108 100644 --- a/apps/opik-backend/src/main/java/com/comet/opik/infrastructure/RedisConfig.java +++ b/apps/opik-backend/src/main/java/com/comet/opik/infrastructure/RedisConfig.java @@ -1,6 +1,6 @@ package com.comet.opik.infrastructure; -import com.comet.opik.infrastructure.redis.RedisUrlParser; +import com.comet.opik.infrastructure.redis.RedisUrl; import com.comet.opik.utils.JsonUtils; import com.fasterxml.jackson.annotation.JsonProperty; import jakarta.validation.Valid; @@ -20,7 +20,7 @@ public class RedisConfig { public Config build() { Config config = new Config(); - var redisUrl = RedisUrlParser.parse(singleNodeUrl); + var redisUrl = RedisUrl.parse(singleNodeUrl); Objects.requireNonNull(singleNodeUrl, "singleNodeUrl must not be null"); diff --git a/apps/opik-backend/src/main/java/com/comet/opik/infrastructure/redis/RedisUrlParser.java b/apps/opik-backend/src/main/java/com/comet/opik/infrastructure/redis/RedisUrl.java similarity index 80% rename from apps/opik-backend/src/main/java/com/comet/opik/infrastructure/redis/RedisUrlParser.java rename to apps/opik-backend/src/main/java/com/comet/opik/infrastructure/redis/RedisUrl.java index b8b136d1f6..2d53778b27 100644 --- a/apps/opik-backend/src/main/java/com/comet/opik/infrastructure/redis/RedisUrlParser.java +++ b/apps/opik-backend/src/main/java/com/comet/opik/infrastructure/redis/RedisUrl.java @@ -3,9 +3,9 @@ import java.net.URI; import java.net.URISyntaxException; -public record RedisUrlParser(String scheme, String host, int port, int database) { +public record RedisUrl(String scheme, String host, int port, int database) { - public static RedisUrlParser parse(String redisUrl) { + public static RedisUrl parse(String redisUrl) { try { URI uri = new URI(redisUrl); String scheme = uri.getScheme(); @@ -18,7 +18,7 @@ public static RedisUrlParser parse(String redisUrl) { database = getDatabase(path); } - return new RedisUrlParser(scheme, host, port, database); + return new RedisUrl(scheme, host, port, database); } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } diff --git a/apps/opik-backend/src/test/java/com/comet/opik/infrastructure/redis/RedisUrlParserTest.java b/apps/opik-backend/src/test/java/com/comet/opik/infrastructure/redis/RedisUrlTest.java similarity index 74% rename from apps/opik-backend/src/test/java/com/comet/opik/infrastructure/redis/RedisUrlParserTest.java rename to apps/opik-backend/src/test/java/com/comet/opik/infrastructure/redis/RedisUrlTest.java index f5d66e1f7d..6f4f2b03cf 100644 --- a/apps/opik-backend/src/test/java/com/comet/opik/infrastructure/redis/RedisUrlParserTest.java +++ b/apps/opik-backend/src/test/java/com/comet/opik/infrastructure/redis/RedisUrlTest.java @@ -7,10 +7,10 @@ import java.util.stream.Stream; -import static org.junit.jupiter.api.Assertions.*; +import static org.assertj.core.api.Assertions.assertThat; @DisplayName("Redis URL parser Unit Test") -class RedisUrlParserTest { +class RedisUrlTest { public static Stream testRedisUrlParser() { return Stream.of( @@ -26,12 +26,12 @@ public static Stream testRedisUrlParser() { @MethodSource @DisplayName("Test parse method with different URLs") void testRedisUrlParser(String redisUrl, String scheme, String host, int port, int database) { - RedisUrlParser redisUrlParser = RedisUrlParser.parse(redisUrl); + RedisUrl redisUrlParser = RedisUrl.parse(redisUrl); - assertEquals(scheme, redisUrlParser.scheme()); - assertEquals(host, redisUrlParser.host()); - assertEquals(port, redisUrlParser.port()); - assertEquals(database, redisUrlParser.database()); + assertThat(scheme).isEqualTo(redisUrlParser.scheme()); + assertThat(host).isEqualTo(redisUrlParser.host()); + assertThat(port).isEqualTo(redisUrlParser.port()); + assertThat(database).isEqualTo(redisUrlParser.database()); } -} \ No newline at end of file +}