From f647feead3adcfcf5a9b83587c45e5a2f9301660 Mon Sep 17 00:00:00 2001 From: Kostiantyn Shchepanovskyi Date: Fri, 10 Jan 2020 18:48:28 +0200 Subject: [PATCH] Fix RedisURIBuilderUnitTests failing on Windows OS Add @DisabledOnOs(OS.WINDOWS) to two tests - `redisSocket` and `redisSocketWithPassword` that fail in Windows: ``` java.lang.IllegalArgumentException: Illegal character in authority at index 15: redis-socket://C:\Users\konstantinsh\IdeaProjects\lettuce-core\work\socket-6479 at java.base/java.net.URI.create(URI.java:883) at io.lettuce.core.RedisURI.create(RedisURI.java:233) ``` Tests are disabled on Windows as socket connections are not supposed to be used on OS other that Unix. --- src/test/java/io/lettuce/core/RedisURIBuilderUnitTests.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/java/io/lettuce/core/RedisURIBuilderUnitTests.java b/src/test/java/io/lettuce/core/RedisURIBuilderUnitTests.java index 8c96e43c51..9275104cc8 100644 --- a/src/test/java/io/lettuce/core/RedisURIBuilderUnitTests.java +++ b/src/test/java/io/lettuce/core/RedisURIBuilderUnitTests.java @@ -23,6 +23,9 @@ import java.time.Duration; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledOnOs; +import org.junit.jupiter.api.condition.EnabledOnOs; +import org.junit.jupiter.api.condition.OS; /** * Unit tests for {@link RedisURI.Builder}. @@ -241,6 +244,7 @@ void invalidScheme() { } @Test + @DisabledOnOs(OS.WINDOWS) void redisSocket() throws IOException { File file = new File("work/socket-6479").getCanonicalFile(); RedisURI result = RedisURI.create(RedisURI.URI_SCHEME_REDIS_SOCKET + "://" + file.getCanonicalPath()); @@ -254,6 +258,7 @@ void redisSocket() throws IOException { } @Test + @DisabledOnOs(OS.WINDOWS) void redisSocketWithPassword() throws IOException { File file = new File("work/socket-6479").getCanonicalFile(); RedisURI result = RedisURI.create(RedisURI.URI_SCHEME_REDIS_SOCKET + "://password@" + file.getCanonicalPath());