Test cleanup in Kafka Streams binder modules
Part of fixing https://github.com/spring-cloud/spring-cloud-stream/issues/2371.
This commit is contained in:
@@ -29,7 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class KafkaStreamsBinderUtilsTests {
|
||||
|
||||
@Test
|
||||
void testDeriveFunctionUnitsWithVariedSpacings() {
|
||||
void deriveFunctionUnitsWithVariedSpacings() {
|
||||
final String definition = "firstFunction; secondFunction; thirdFunction;fourthFunction";
|
||||
|
||||
final String[] functionUnits = KafkaStreamsBinderUtils.deriveFunctionUnits(definition);
|
||||
|
||||
@@ -84,7 +84,7 @@ class KafkaStreamsEventTypeRoutingTests {
|
||||
|
||||
//See https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/1003 for more context on this test.
|
||||
@Test
|
||||
void testRoutingWorksBasedOnEventTypes() {
|
||||
void routingWorksBasedOnEventTypes() {
|
||||
SpringApplication app = new SpringApplication(EventTypeRoutingTestConfig.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
@@ -154,7 +154,7 @@ class KafkaStreamsEventTypeRoutingTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testRoutingWorksBasedOnEventTypesConsumer() throws Exception {
|
||||
void routingWorksBasedOnEventTypesConsumer() throws Exception {
|
||||
SpringApplication app = new SpringApplication(EventTypeRoutingTestConfig.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ class KafkaStreamsFunctionCompositionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testBasicFunctionCompositionWithDefaultDestination() throws InterruptedException {
|
||||
void basicFunctionCompositionWithDefaultDestination() throws InterruptedException {
|
||||
SpringApplication app = new SpringApplication(FunctionCompositionConfig1.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
@@ -114,7 +114,7 @@ class KafkaStreamsFunctionCompositionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testBasicFunctionCompositionWithDestinaion() throws InterruptedException {
|
||||
void basicFunctionCompositionWithDestinaion() throws InterruptedException {
|
||||
SpringApplication app = new SpringApplication(FunctionCompositionConfig1.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
@@ -214,7 +214,7 @@ class KafkaStreamsFunctionCompositionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testChainedFunctionsAsComposed() throws InterruptedException {
|
||||
void chainedFunctionsAsComposed() throws InterruptedException {
|
||||
SpringApplication app = new SpringApplication(FunctionCompositionConfig4.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
@@ -257,7 +257,7 @@ class KafkaStreamsFunctionCompositionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFirstFunctionCurriedThenComposeWithOtherFunctions() throws InterruptedException {
|
||||
void firstFunctionCurriedThenComposeWithOtherFunctions() throws InterruptedException {
|
||||
SpringApplication app = new SpringApplication(FunctionCompositionConfig5.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ class KafkaStreamsBinderBootstrapTest {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
void testStreamConfigGlobalProperties_GH1149() {
|
||||
void streamConfigGlobalProperties_GH1149() {
|
||||
ConfigurableApplicationContext applicationContext = new SpringApplicationBuilder(
|
||||
SimpleKafkaStreamsApplication.class).web(WebApplicationType.NONE).run(
|
||||
"--spring.cloud.function.definition=input1;input2;input3",
|
||||
|
||||
@@ -65,7 +65,7 @@ class KafkaStreamsBinderJaasInitTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testKafkaStreamsBinderJaasInitialization() {
|
||||
void kafkaStreamsBinderJaasInitialization() {
|
||||
ConfigurableApplicationContext applicationContext = new SpringApplicationBuilder(
|
||||
KafkaStreamsBinderJaasInitTestsApplication.class).web(WebApplicationType.NONE).run(
|
||||
"--spring.cloud.function.definition=foo",
|
||||
|
||||
@@ -75,7 +75,7 @@ class KafkaStreamsBinderWordCountBranchesFunctionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testKstreamWordCountWithStringInputAndPojoOuput() throws Exception {
|
||||
void kstreamWordCountWithStringInputAndPojoOuput() throws Exception {
|
||||
SpringApplication app = new SpringApplication(WordCountProcessorApplication.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ class KafkaStreamsBinderWordCountFunctionTests {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
void testBasicKStreamTopologyExecution() throws Exception {
|
||||
void basicKStreamTopologyExecution() throws Exception {
|
||||
SpringApplication app = new SpringApplication(WordCountProcessorApplication.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
@@ -175,7 +175,7 @@ class KafkaStreamsBinderWordCountFunctionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testKstreamWordCountWithApplicationIdSpecifiedAtDefaultConsumer() {
|
||||
void kstreamWordCountWithApplicationIdSpecifiedAtDefaultConsumer() {
|
||||
SpringApplication app = new SpringApplication(WordCountProcessorApplication.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
@@ -196,7 +196,7 @@ class KafkaStreamsBinderWordCountFunctionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testKstreamWordCountFunctionWithCustomProducerStreamPartitioner() throws Exception {
|
||||
void kstreamWordCountFunctionWithCustomProducerStreamPartitioner() throws Exception {
|
||||
SpringApplication app = new SpringApplication(WordCountProcessorApplication.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
@@ -236,7 +236,7 @@ class KafkaStreamsBinderWordCountFunctionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testKstreamBinderAutoStartup() throws Exception {
|
||||
void kstreamBinderAutoStartup() throws Exception {
|
||||
SpringApplication app = new SpringApplication(WordCountProcessorApplication.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
@@ -258,7 +258,7 @@ class KafkaStreamsBinderWordCountFunctionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testKstreamIndividualBindingAutoStartup() throws Exception {
|
||||
void kstreamIndividualBindingAutoStartup() throws Exception {
|
||||
SpringApplication app = new SpringApplication(WordCountProcessorApplication.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
@@ -283,7 +283,7 @@ class KafkaStreamsBinderWordCountFunctionTests {
|
||||
// The following test verifies the fixes made for this issue:
|
||||
// https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/774
|
||||
@Test
|
||||
void testOutboundNullValueIsHandledGracefully()
|
||||
void outboundNullValueIsHandledGracefully()
|
||||
throws Exception {
|
||||
SpringApplication app = new SpringApplication(OutboundNullApplication.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
@@ -101,7 +101,7 @@ class KafkaStreamsComponentBeansTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFunctionComponent() {
|
||||
void functionComponent() {
|
||||
SpringApplication app = new SpringApplication(FunctionAsComponent.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
try (ConfigurableApplicationContext ignored = app.run(
|
||||
@@ -127,7 +127,7 @@ class KafkaStreamsComponentBeansTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testConsumerComponent() throws Exception {
|
||||
void consumerComponent() throws Exception {
|
||||
SpringApplication app = new SpringApplication(ConsumerAsComponent.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
try (ConfigurableApplicationContext context = app.run(
|
||||
@@ -151,7 +151,7 @@ class KafkaStreamsComponentBeansTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testBiFunctionComponent() {
|
||||
void biFunctionComponent() {
|
||||
SpringApplication app = new SpringApplication(BiFunctionAsComponent.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
try (ConfigurableApplicationContext ignored = app.run(
|
||||
@@ -181,7 +181,7 @@ class KafkaStreamsComponentBeansTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testBiConsumerComponent() throws Exception {
|
||||
void biConsumerComponent() throws Exception {
|
||||
SpringApplication app = new SpringApplication(BiConsumerAsComponent.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
try (ConfigurableApplicationContext context = app.run(
|
||||
@@ -208,7 +208,7 @@ class KafkaStreamsComponentBeansTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCurriedFunctionWithConsumerTerminal() throws Exception {
|
||||
void curriedFunctionWithConsumerTerminal() throws Exception {
|
||||
SpringApplication app = new SpringApplication(CurriedFunctionWithConsumerTerminal.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
try (ConfigurableApplicationContext context = app.run(
|
||||
@@ -238,7 +238,7 @@ class KafkaStreamsComponentBeansTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCurriedFunctionWithFunctionTerminal() {
|
||||
void curriedFunctionWithFunctionTerminal() {
|
||||
SpringApplication app = new SpringApplication(CurriedFunctionWithFunctionTerminal.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
try (ConfigurableApplicationContext context = app.run(
|
||||
|
||||
@@ -51,7 +51,7 @@ class KafkaStreamsFunctionStateStoreTests {
|
||||
private static final EmbeddedKafkaBroker embeddedKafka = EmbeddedKafkaCondition.getBroker();
|
||||
|
||||
@Test
|
||||
void testKafkaStreamsFuncionWithMultipleStateStores() throws Exception {
|
||||
void kafkaStreamsFuncionWithMultipleStateStores() throws Exception {
|
||||
SpringApplication app = new SpringApplication(StateStoreTestApplication.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ class KafkaStreamsRetryTests {
|
||||
private final static CountDownLatch LATCH2 = new CountDownLatch(4);
|
||||
|
||||
@Test
|
||||
void testRetryTemplatePerBindingOnKStream() throws Exception {
|
||||
void retryTemplatePerBindingOnKStream() throws Exception {
|
||||
SpringApplication app = new SpringApplication(RetryTemplatePerConsumerBindingApp.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
@@ -83,7 +83,7 @@ class KafkaStreamsRetryTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testRetryTemplateOnTableTypes() throws Exception {
|
||||
void retryTemplateOnTableTypes() throws Exception {
|
||||
SpringApplication app = new SpringApplication(RetryTemplatePerConsumerBindingApp.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
@@ -100,7 +100,7 @@ class KafkaStreamsRetryTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testRetryTemplateBeanProvidedByTheApp() throws Exception {
|
||||
void retryTemplateBeanProvidedByTheApp() throws Exception {
|
||||
SpringApplication app = new SpringApplication(CustomRetryTemplateApp.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ class StreamToGlobalKTableFunctionTests {
|
||||
private static Consumer<Long, EnrichedOrder> consumer;
|
||||
|
||||
@Test
|
||||
void testStreamToGlobalKTable() throws Exception {
|
||||
void streamToGlobalKTable() throws Exception {
|
||||
SpringApplication app = new SpringApplication(OrderEnricherApplication.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
try (ConfigurableApplicationContext context = app.run("--server.port=0",
|
||||
@@ -222,7 +222,7 @@ class StreamToGlobalKTableFunctionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testTimeExtractor() throws Exception {
|
||||
void timeExtractor() throws Exception {
|
||||
SpringApplication app = new SpringApplication(OrderEnricherApplication.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ class StreamToTableJoinFunctionTests {
|
||||
private static final EmbeddedKafkaBroker embeddedKafka = EmbeddedKafkaCondition.getBroker();
|
||||
|
||||
@Test
|
||||
void testStreamToTable() {
|
||||
void streamToTable() {
|
||||
SpringApplication app = new SpringApplication(CountClicksPerRegionApplication.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
@@ -96,7 +96,7 @@ class StreamToTableJoinFunctionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testStreamToTableBiFunction() {
|
||||
void streamToTableBiFunction() {
|
||||
SpringApplication app = new SpringApplication(BiFunctionCountClicksPerRegionApplication.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
@@ -114,7 +114,7 @@ class StreamToTableJoinFunctionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testStreamToTableBiConsumer() throws Exception {
|
||||
void streamToTableBiConsumer() throws Exception {
|
||||
SpringApplication app = new SpringApplication(BiConsumerApplication.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
@@ -433,7 +433,7 @@ class StreamToTableJoinFunctionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTrivialSingleKTableInputAsNonDeclarative() {
|
||||
public void trivialSingleKTableInputAsNonDeclarative() {
|
||||
SpringApplication app = new SpringApplication(TrivialKTableApp.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
app.run("--server.port=0",
|
||||
@@ -446,7 +446,7 @@ class StreamToTableJoinFunctionTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTwoKStreamsCanBeJoined() {
|
||||
public void twoKStreamsCanBeJoined() {
|
||||
SpringApplication app = new SpringApplication(
|
||||
JoinProcessor.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
@@ -59,7 +59,7 @@ class DlqDestinationResolverTests {
|
||||
private static final EmbeddedKafkaBroker embeddedKafka = EmbeddedKafkaCondition.getBroker();
|
||||
|
||||
@Test
|
||||
void testDlqDestinationResolverWorks() throws Exception {
|
||||
void dlqDestinationResolverWorks() throws Exception {
|
||||
SpringApplication app = new SpringApplication(WordCountProcessorApplication.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ class DltAwareProcessorTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDltAwareProcessor() {
|
||||
void dltAwareProcessor() {
|
||||
SpringApplication app = new SpringApplication(
|
||||
DltAwareProcessorTests.PublishToDltOnErrorApplication.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
@@ -66,7 +66,7 @@ class KafkaStreamsBinderDestinationIsPatternTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void test() {
|
||||
void destinationIsPattern() {
|
||||
SpringApplication app = new SpringApplication(ConsumingApplication.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
ConfigurableApplicationContext context = app.run("--server.port=0",
|
||||
|
||||
@@ -85,7 +85,7 @@ class KafkaStreamsBinderMultipleInputTopicsTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testKstreamWordCountWithStringInputAndPojoOuput() throws Exception {
|
||||
void kstreamWordCountWithStringInputAndPojoOuput() throws Exception {
|
||||
SpringApplication app = new SpringApplication(
|
||||
WordCountProcessorApplication.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
|
||||
@@ -78,7 +78,7 @@ class KafkaStreamsBinderPojoInputAndPrimitiveTypeOutputTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testKstreamBinderWithPojoInputAndStringOuput() throws Exception {
|
||||
void kstreamBinderWithPojoInputAndStringOuput() throws Exception {
|
||||
SpringApplication app = new SpringApplication(ProductCountApplication.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
ConfigurableApplicationContext context = app.run("--server.port=0",
|
||||
|
||||
@@ -86,7 +86,7 @@ class KafkaStreamsBinderTombstoneTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSendToTombstone()
|
||||
void sendToTombstone()
|
||||
throws Exception {
|
||||
SpringApplication app = new SpringApplication(
|
||||
WordCountProcessorApplication.class);
|
||||
|
||||
@@ -116,7 +116,7 @@ public abstract class KafkaStreamsNativeEncodingDecodingTests {
|
||||
extends KafkaStreamsNativeEncodingDecodingTests {
|
||||
|
||||
@Test
|
||||
public void test() throws Exception {
|
||||
public void nativeEncodingDecodingEnabled() throws Exception {
|
||||
Map<String, Object> senderProps = KafkaTestUtils.producerProps(embeddedKafka);
|
||||
DefaultKafkaProducerFactory<Integer, String> pf = new DefaultKafkaProducerFactory<>(
|
||||
senderProps);
|
||||
@@ -146,7 +146,7 @@ public abstract class KafkaStreamsNativeEncodingDecodingTests {
|
||||
extends KafkaStreamsNativeEncodingDecodingTests {
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
public void nativeEncodingDecodingDisabled() {
|
||||
Map<String, Object> senderProps = KafkaTestUtils.producerProps(embeddedKafka);
|
||||
DefaultKafkaProducerFactory<Integer, String> pf = new DefaultKafkaProducerFactory<>(
|
||||
senderProps);
|
||||
|
||||
@@ -84,7 +84,7 @@ class KafkaStreamsStateStoreIntegrationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSameStateStoreIsCreatedOnlyOnceWhenMultipleInputBindingsArePresent() throws Exception {
|
||||
void sameStateStoreIsCreatedOnlyOnceWhenMultipleInputBindingsArePresent() throws Exception {
|
||||
SpringApplication app = new SpringApplication(ProductCountApplicationWithMultipleInputBindings.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
ConfigurableApplicationContext context = app.run("--server.port=0",
|
||||
|
||||
@@ -80,7 +80,7 @@ class KafkastreamsBinderPojoInputStringOutputIntegrationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testKstreamBinderWithPojoInputAndStringOuput() throws Exception {
|
||||
void kstreamBinderWithPojoInputAndStringOuput() throws Exception {
|
||||
SpringApplication app = new SpringApplication(ProductCountApplication.class);
|
||||
app.setWebApplicationType(WebApplicationType.NONE);
|
||||
ConfigurableApplicationContext context = app.run("--server.port=0",
|
||||
|
||||
@@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class CollectionSerdeTest {
|
||||
|
||||
@Test
|
||||
public void testCollectionsSerde() {
|
||||
public void collectionsSerde() {
|
||||
|
||||
Foo foo1 = new Foo();
|
||||
foo1.setData("data-1");
|
||||
|
||||
Reference in New Issue
Block a user