Skip to content

Commit 7cb2ab0

Browse files
authored
Merge pull request #50080 from holly-cummins/add-redis-preload-test
Add test which makes sure import.redis works for redis dev services
2 parents faf972c + df04d26 commit 7cb2ab0

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SET dog 'lassie'

integration-tests/redis-devservices/src/test/java/io/quarkus/redis/devservices/it/DevServicesRedisTest.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.junit.jupiter.api.BeforeEach;
88
import org.junit.jupiter.api.DisplayName;
99
import org.junit.jupiter.api.Test;
10+
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
1011

1112
import io.quarkus.redis.devservices.it.profiles.DevServiceRedis;
1213
import io.quarkus.test.junit.QuarkusTest;
@@ -32,10 +33,21 @@ public void shouldStartRedisContainer() {
3233

3334
@Test
3435
@DisplayName("given redis container must communicate with it and return value by key")
35-
public void shouldReturnAllKeys() {
36+
public void shouldReturnKnownKey() {
3637
when().get("/get/anykey").then()
3738
.statusCode(200)
3839
.body(is("anyvalue"));
3940
}
4041

42+
// For some reason, the quarkus.test.native isn't being set in the failsafe path with -Pnative
43+
// We'll just use a different property that is being set instead
44+
@DisabledIfSystemProperty(named = "native.image.path", matches = ".*", disabledReason = "Not working; tracked by https://github.com/quarkusio/quarkus/issues/50085")
45+
@Test
46+
@DisplayName("given redis container must have been preloaded with contents of import.redis")
47+
public void shouldReturnPreloadKeys() {
48+
when().get("/get/dog").then()
49+
.statusCode(200)
50+
.body(is("lassie"));
51+
}
52+
4153
}

0 commit comments

Comments
 (0)