|
5 | 5 | import io.dapr.testcontainers.Component; |
6 | 6 | import io.dapr.testcontainers.DaprContainer; |
7 | 7 | import io.dapr.testcontainers.DaprLogLevel; |
| 8 | +import org.junit.jupiter.api.AfterAll; |
8 | 9 | import org.junit.jupiter.api.Tag; |
9 | 10 | import org.junit.jupiter.api.Test; |
10 | 11 | import org.junit.jupiter.api.extension.ExtendWith; |
|
14 | 15 | import org.springframework.boot.test.context.SpringBootTest; |
15 | 16 | import org.springframework.boot.testcontainers.service.connection.ServiceConnection; |
16 | 17 | import org.springframework.test.context.ContextConfiguration; |
| 18 | +import org.springframework.test.context.DynamicPropertyRegistry; |
| 19 | +import org.springframework.test.context.DynamicPropertySource; |
17 | 20 | import org.springframework.test.context.junit.jupiter.SpringExtension; |
18 | 21 | import org.testcontainers.containers.Network; |
19 | 22 | import org.testcontainers.junit.jupiter.Container; |
20 | 23 | import org.testcontainers.junit.jupiter.Testcontainers; |
21 | 24 | import redis.clients.jedis.Jedis; |
22 | 25 |
|
| 26 | +import java.util.List; |
23 | 27 | import java.util.Map; |
24 | 28 |
|
25 | 29 | import static io.dapr.it.testcontainers.DaprContainerConstants.IMAGE_TAG; |
|
30 | 34 | + "/" + DaprCloudConfigIT.CONFIG_MULTI_NAME + "?type=doc&doc-type=yaml", |
31 | 35 | "spring.config.import[1]=dapr:config:" + DaprCloudConfigIT.CONFIG_STORE_NAME |
32 | 36 | + "/" + DaprCloudConfigIT.CONFIG_SINGLE_NAME + "?type=value", |
| 37 | + "dapr.cloudconfig.wait-sidecar-enabled=true", |
| 38 | + "dapr.cloudconfig.wait-sidecar-retries=5", |
33 | 39 | }) |
34 | 40 | @ContextConfiguration(classes = TestDaprCloudConfigConfiguration.class) |
35 | 41 | @ExtendWith(SpringExtension.class) |
@@ -69,13 +75,17 @@ protected void containerIsStarted(InspectContainerResponse containerInfo) { |
69 | 75 | @Container |
70 | 76 | @ServiceConnection |
71 | 77 | private static final DaprContainer DAPR_CONTAINER = new DaprContainer(IMAGE_TAG) |
72 | | - .withAppName("secret-store-dapr-app") |
| 78 | + .withAppName("configuration-dapr-app") |
73 | 79 | .withNetwork(DAPR_NETWORK) |
74 | 80 | .withComponent(new Component(CONFIG_STORE_NAME, "configuration.redis", "v1", STORE_PROPERTY)) |
75 | 81 | .withDaprLogLevel(DaprLogLevel.DEBUG) |
76 | 82 | .withLogConsumer(outputFrame -> System.out.println(outputFrame.getUtf8String())) |
77 | 83 | .dependsOn(REDIS_CONTAINER); |
78 | 84 |
|
| 85 | + static { |
| 86 | + DAPR_CONTAINER.setPortBindings(List.of("3500:3500", "50001:50001")); |
| 87 | + } |
| 88 | + |
79 | 89 | private static Map<String, String> generateStoreProperty() { |
80 | 90 | return Map.of("redisHost", "redis:6379", |
81 | 91 | "redisPassword", ""); |
|
0 commit comments