Skip to content

Commit

Permalink
Fix RedisURIBuilderUnitTests failing on Windows OS #1204
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kshchepanovskyi authored and mp911de committed Jan 13, 2020
1 parent 958f9e1 commit 4bf804c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/java/io/lettuce/core/RedisURIBuilderUnitTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
Expand Down Expand Up @@ -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());
Expand All @@ -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());
Expand Down

0 comments on commit 4bf804c

Please sign in to comment.