|
12 | 12 | import org.apache.kafka.clients.admin.AdminClientConfig; |
13 | 13 | import org.apache.kafka.clients.admin.NewTopic; |
14 | 14 | import org.jetbrains.annotations.NotNull; |
| 15 | +import org.junit.jupiter.api.AfterEach; |
| 16 | +import org.junit.jupiter.api.BeforeEach; |
15 | 17 | import org.junit.jupiter.api.function.ThrowingConsumer; |
16 | 18 | import org.junit.jupiter.api.io.TempDir; |
17 | 19 | import org.springframework.beans.factory.annotation.Autowired; |
18 | 20 | import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient; |
19 | 21 | import org.springframework.boot.test.context.SpringBootTest; |
20 | 22 | import org.springframework.context.ApplicationContextInitializer; |
21 | 23 | import org.springframework.context.ConfigurableApplicationContext; |
| 24 | +import org.springframework.test.annotation.DirtiesContext; |
22 | 25 | import org.springframework.test.context.ActiveProfiles; |
23 | 26 | import org.springframework.test.context.ContextConfiguration; |
24 | 27 | import org.springframework.test.util.TestSocketUtils; |
@@ -63,16 +66,14 @@ public abstract class AbstractIntegrationTest { |
63 | 66 | @TempDir |
64 | 67 | public static Path tmpDir; |
65 | 68 |
|
66 | | - static { |
67 | | - kafka.start(); |
68 | | - schemaRegistry.start(); |
69 | | - kafkaConnect.start(); |
70 | | - } |
71 | | - |
72 | 69 | public static class Initializer |
73 | 70 | implements ApplicationContextInitializer<ConfigurableApplicationContext> { |
74 | 71 | @Override |
75 | 72 | public void initialize(@NotNull ConfigurableApplicationContext context) { |
| 73 | + kafka.start(); |
| 74 | + schemaRegistry.start(); |
| 75 | + kafkaConnect.start(); |
| 76 | + |
76 | 77 | System.setProperty("kafka.clusters.0.name", LOCAL); |
77 | 78 | System.setProperty("kafka.clusters.0.bootstrapServers", kafka.getBootstrapServers()); |
78 | 79 | // List unavailable hosts to verify failover |
|
0 commit comments