Package org.opennms.core.test.kafka
Class JUnitKafkaServer
- java.lang.Object
-
- org.junit.rules.ExternalResource
-
- org.opennms.core.test.kafka.JUnitKafkaServer
-
- All Implemented Interfaces:
org.junit.rules.TestRule
public class JUnitKafkaServer extends org.junit.rules.ExternalResource
This class starts up an embedded Kafka server for use in integration tests.- Author:
- Seth
-
-
Constructor Summary
Constructors Constructor Description JUnitKafkaServer()
JUnitKafkaServer(String kafkaLogDir)
JUnitKafkaServer(org.junit.rules.TemporaryFolder temporaryFolder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
after()
void
before()
String
getKafkaConnectString()
String
getZookeeperConnectString()
void
startKafkaServer()
void
stopKafkaServer()
-
-
-
Constructor Detail
-
JUnitKafkaServer
public JUnitKafkaServer()
-
JUnitKafkaServer
public JUnitKafkaServer(String kafkaLogDir)
-
JUnitKafkaServer
public JUnitKafkaServer(org.junit.rules.TemporaryFolder temporaryFolder)
-
-
Method Detail
-
before
public void before() throws Exception
- Overrides:
before
in classorg.junit.rules.ExternalResource
- Throws:
Exception
-
after
public void after()
- Overrides:
after
in classorg.junit.rules.ExternalResource
-
getKafkaConnectString
public String getKafkaConnectString()
-
getZookeeperConnectString
public String getZookeeperConnectString()
-
stopKafkaServer
public void stopKafkaServer()
-
startKafkaServer
public void startKafkaServer()
-
-