Skip to content

Commit

Permalink
stop after class
Browse files Browse the repository at this point in the history
  • Loading branch information
h1alexbel committed May 22, 2023
1 parent 66f9d27 commit d1b3226
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/it/producer-consumer-api/src/test/java/KafkaITCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/

import org.cactoos.list.ListOf;
import org.junit.AfterClass;
import org.junit.jupiter.api.BeforeAll;
import org.slf4j.LoggerFactory;
import org.testcontainers.containers.KafkaContainer;
Expand All @@ -37,6 +38,9 @@
*/
public abstract class KafkaITCase {

/**
* Kafka Docker Container.
*/
protected static final KafkaContainer KAFKA = new KafkaContainer(
DockerImageName.parse("confluentinc/cp-kafka:7.3.0")
)
Expand All @@ -50,6 +54,9 @@ public abstract class KafkaITCase {
)
)
.withEmbeddedZookeeper();
/**
* Bootstrap servers.
*/
protected static String servers;

@BeforeAll
Expand All @@ -70,4 +77,9 @@ static void setup() {
)
);
}

@AfterClass
void tearDown() {
KafkaITCase.KAFKA.stop();
}
}

0 comments on commit d1b3226

Please sign in to comment.