Restore the option to run Kafka tests embedded vs. external
Honour the `SCS_KAFKA_TEST_EMBEDDED` flag when set as an environment variable or Java property: when explicitly set to `false`, use an external broker and observe the `SCS_EXTERNAL_SERVERS_REQUIRED` property (i.e. fail if server is missing). By default, continue to run tests using an embedded broker.
This commit is contained in:
@@ -84,7 +84,7 @@ public class KafkaBinderTests extends PartitionCapableBinderTests<KafkaTestBinde
|
||||
private final String CLASS_UNDER_TEST_NAME = KafkaMessageChannelBinder.class.getSimpleName();
|
||||
|
||||
@ClassRule
|
||||
public static KafkaTestSupport kafkaTestSupport = new KafkaTestSupport(true);
|
||||
public static KafkaTestSupport kafkaTestSupport = new KafkaTestSupport();
|
||||
|
||||
private KafkaTestBinder binder;
|
||||
|
||||
|
||||
@@ -194,7 +194,6 @@ public abstract class AbstractBinderTests<B extends AbstractTestBinder<? extends
|
||||
if (testBinder != null) {
|
||||
testBinder.cleanup();
|
||||
}
|
||||
System.clearProperty("SCS_KAFKA_TEST_EMBEDDED");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -70,7 +70,9 @@ public class KafkaTestSupport extends AbstractExternalResourceTestSupport<String
|
||||
|
||||
static {
|
||||
// check if either the environment or Java property is set to use embedded tests
|
||||
defaultEmbedded = "true".equals(System.getenv(SCS_KAFKA_TEST_EMBEDDED)) || "true".equals(System.getProperty(SCS_KAFKA_TEST_EMBEDDED));
|
||||
// unless the property is explicitly set to false, default to embedded
|
||||
defaultEmbedded = !("false".equals(System.getenv(SCS_KAFKA_TEST_EMBEDDED))
|
||||
|| "false".equals(System.getProperty(SCS_KAFKA_TEST_EMBEDDED)));
|
||||
}
|
||||
|
||||
public KafkaTestSupport() {
|
||||
|
||||
Reference in New Issue
Block a user