Skip to content

Commit b868a65

Browse files
committed
Tests
1 parent a2d0a78 commit b868a65

File tree

5 files changed

+23
-7
lines changed

5 files changed

+23
-7
lines changed

src/test/kotlin/io/github/tobi/laa/spring/boot/embedded/redis/server/CustomSettingsTest.kt

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,36 @@ import org.junit.jupiter.api.Order
77
import org.junit.jupiter.api.Test
88
import org.springframework.beans.factory.annotation.Autowired
99

10+
private const val TEST_PORT = 10001
11+
private const val TEST_BIND = "::1"
12+
1013
@IntegrationTest
1114
@EmbeddedRedisServer(
12-
port = 10000,
15+
port = TEST_PORT,
16+
bind = TEST_BIND,
1317
settings = [
1418
"appendonly no",
1519
"protected-mode yes",
16-
"appendfsync everysec",
17-
"port 12345"]
20+
"appendfsync everysec"]
1821
)
1922
@DisplayName("Using @EmbeddedRedisServer with custom settings")
2023
internal class CustomSettingsTest {
2124

2225
@Autowired
2326
private lateinit var given: RedisTests
2427

28+
@Test
29+
@DisplayName("RedisProperties should have the customized values")
30+
@Order(1)
31+
fun redisPropertiesShouldHaveCustomizedValues() {
32+
given.nothing()
33+
.whenDoingNothing()
34+
.then().redisProperties()
35+
.shouldBeStandalone().and()
36+
.shouldHaveHost(TEST_BIND).and()
37+
.shouldHavePort(TEST_PORT)
38+
}
39+
2540
@Test
2641
@DisplayName("It should be possible to write to Redis and the data should be available afterwards")
2742
@Order(2)

src/test/kotlin/io/github/tobi/laa/spring/boot/embedded/redis/server/CustomizerTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test
99
import org.springframework.beans.factory.annotation.Autowired
1010
import redis.embedded.core.RedisServerBuilder
1111

12-
private const val TEST_PORT = 11111
12+
private const val TEST_PORT = 10000
1313

1414
@IntegrationTest
1515
@EmbeddedRedisServer(

src/test/kotlin/io/github/tobi/laa/spring/boot/embedded/redis/server/DefaultSettingsTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import org.junit.jupiter.api.DisplayName
66
import org.junit.jupiter.api.Order
77
import org.junit.jupiter.api.Test
88
import org.springframework.beans.factory.annotation.Autowired
9+
import redis.embedded.Redis
910

1011
@IntegrationTest
1112
@EmbeddedRedisServer
@@ -24,7 +25,7 @@ internal open class DefaultSettingsTest {
2425
.then().redisProperties()
2526
.shouldBeStandalone().and()
2627
.shouldHaveHost("localhost").and()
27-
.shouldHavePort(6379)
28+
.shouldHavePort(Redis.DEFAULT_REDIS_PORT)
2829
}
2930

3031
@Test

src/test/kotlin/io/github/tobi/laa/spring/boot/embedded/redis/server/ExecutionDirTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import org.junit.jupiter.api.Test
77
import org.springframework.beans.factory.annotation.Autowired
88

99
@IntegrationTest
10-
@EmbeddedRedisServer(executeInDirectory = "build", port = 10001)
10+
@EmbeddedRedisServer(executeInDirectory = "build", port = 10002)
1111
@DisplayName("Using @EmbeddedRedisServer with custom execution dir")
1212
internal class ExecutionDirTest {
1313

src/test/kotlin/io/github/tobi/laa/spring/boot/embedded/redis/server/RedisConfFileTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired
99

1010
@IntegrationTest
1111
@EmbeddedRedisServer(
12-
port = 12345,
12+
port = 10003,
1313
configFile = "src/test/resources/server/redis.conf"
1414
)
1515
@DisplayName("Using @EmbeddedRedisServer with config file")

0 commit comments

Comments
 (0)