public class KafkaTestSupport extends AbstractExternalResourceTestSupport<String>
Rule
that starts an embedded Kafka server (with an associated Zookeeper)Modifier and Type | Field and Description |
---|---|
static boolean |
defaultEmbedded |
boolean |
embedded |
logger, resource, SCS_EXTERNAL_SERVERS_REQUIRED
Constructor and Description |
---|
KafkaTestSupport() |
KafkaTestSupport(boolean embedded) |
Modifier and Type | Method and Description |
---|---|
protected void |
cleanupResource()
Perform cleanup of the
AbstractExternalResourceTestSupport.resource field, which is guaranteed to be non null. |
String |
getBrokerAddress() |
kafka.server.KafkaServer |
getKafkaServer() |
org.I0Itec.zkclient.ZkClient |
getZkClient() |
String |
getZkConnectString() |
protected void |
obtainResource()
Try to obtain and validate a resource.
|
apply, getResource
public static final boolean defaultEmbedded
public final boolean embedded
public KafkaTestSupport()
public KafkaTestSupport(boolean embedded)
public kafka.server.KafkaServer getKafkaServer()
public String getZkConnectString()
public org.I0Itec.zkclient.ZkClient getZkClient()
public String getBrokerAddress()
protected void obtainResource() throws Exception
AbstractExternalResourceTestSupport
AbstractExternalResourceTestSupport.resource
field with a valid resource and return normally, or throw an
exception.obtainResource
in class AbstractExternalResourceTestSupport<String>
Exception
protected void cleanupResource() throws Exception
AbstractExternalResourceTestSupport
AbstractExternalResourceTestSupport.resource
field, which is guaranteed to be non null.cleanupResource
in class AbstractExternalResourceTestSupport<String>
Exception
- any exception thrown by this method will be logged and swallowedCopyright © 2016 Pivotal Software, Inc.. All rights reserved.