8 changed files with 96 additions and 52 deletions
@ -0,0 +1,20 @@
|
||||
package me.jochrist.kafka; |
||||
import java.util.Collections; |
||||
import java.util.Map; |
||||
import org.testcontainers.containers.KafkaContainer; |
||||
import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; |
||||
|
||||
public class KafkaResource implements QuarkusTestResourceLifecycleManager { |
||||
private final KafkaContainer kafka = new KafkaContainer(); |
||||
|
||||
@Override |
||||
public Map<String, String> start() { |
||||
kafka.start(); |
||||
return Collections.singletonMap("kafka.bootstrap.servers", kafka.getBootstrapServers()); |
||||
} |
||||
|
||||
@Override |
||||
public void stop() { |
||||
kafka.close(); |
||||
} |
||||
} |
||||
Loading…
Reference in new issue