Skip to content

Commit 476d363

Browse files
author
Artur Ciocanu
committed
Move waiting to beforeEach, it looks more natural
Signed-off-by: Artur Ciocanu <[email protected]>
1 parent 0a538d7 commit 476d363

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

sdk-tests/src/test/java/io/dapr/it/spring/messaging/DaprSpringMessagingIT.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import io.dapr.testcontainers.DaprContainer;
2121
import io.dapr.testcontainers.DaprLogLevel;
2222
import org.junit.jupiter.api.BeforeAll;
23+
import org.junit.jupiter.api.BeforeEach;
2324
import org.junit.jupiter.api.Tag;
2425
import org.junit.jupiter.api.Test;
2526
import org.slf4j.Logger;
@@ -80,10 +81,14 @@ public static void beforeAll(){
8081
org.testcontainers.Testcontainers.exposeHostPorts(APP_PORT);
8182
}
8283

83-
@Test
84-
public void testDaprMessagingTemplate() throws InterruptedException {
84+
@BeforeEach
85+
public void beforeEach() {
86+
// Ensure the subscriptions are registered
8587
Wait.forLogMessage(SUBSCRIPTION_MESSAGE_PATTERN, 1).waitUntilReady(DAPR_CONTAINER);
88+
}
8689

90+
@Test
91+
public void testDaprMessagingTemplate() throws InterruptedException {
8792
for (int i = 0; i < 10; i++) {
8893
var msg = "ProduceAndReadWithPrimitiveMessageType:" + i;
8994

0 commit comments

Comments
 (0)