From cf0245d49ec8975aa9a231f38fecfa0e1b984d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Mon, 11 Dec 2023 09:47:35 +0100 Subject: [PATCH 1/4] GH-2927 Resolve subclasses of EmbeddedKafkaBroker in tests --- .../kafka/test/condition/EmbeddedKafkaCondition.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-kafka-test/src/main/java/org/springframework/kafka/test/condition/EmbeddedKafkaCondition.java b/spring-kafka-test/src/main/java/org/springframework/kafka/test/condition/EmbeddedKafkaCondition.java index 706d84dc69..364fc691e4 100644 --- a/spring-kafka-test/src/main/java/org/springframework/kafka/test/condition/EmbeddedKafkaCondition.java +++ b/spring-kafka-test/src/main/java/org/springframework/kafka/test/condition/EmbeddedKafkaCondition.java @@ -72,7 +72,7 @@ public boolean supportsParameter(ParameterContext parameterContext, ExtensionCon return false; } else { - return parameterContext.getParameter().getType().equals(EmbeddedKafkaBroker.class); + return EmbeddedKafkaBroker.class.isAssignableFrom(parameterContext.getParameter().getType()); } } From d3e0a45ee624ca3447ed7fe212e532911860f876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Fri, 15 Dec 2023 13:49:47 +0100 Subject: [PATCH 2/4] GH-2927 Test that zk broker can be resolved --- .../kafka/test/condition/EmbeddedKafkaConditionTests.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spring-kafka-test/src/test/java/org/springframework/kafka/test/condition/EmbeddedKafkaConditionTests.java b/spring-kafka-test/src/test/java/org/springframework/kafka/test/condition/EmbeddedKafkaConditionTests.java index 27b5a93a8f..10452ce2f6 100644 --- a/spring-kafka-test/src/test/java/org/springframework/kafka/test/condition/EmbeddedKafkaConditionTests.java +++ b/spring-kafka-test/src/test/java/org/springframework/kafka/test/condition/EmbeddedKafkaConditionTests.java @@ -21,6 +21,7 @@ import org.junit.jupiter.api.Test; import org.springframework.kafka.test.EmbeddedKafkaBroker; +import org.springframework.kafka.test.EmbeddedKafkaZKBroker; import org.springframework.kafka.test.context.EmbeddedKafka; import org.springframework.kafka.test.utils.KafkaTestUtils; @@ -41,4 +42,9 @@ public void test(EmbeddedKafkaBroker broker) { assertThat(broker.getPartitionsPerTopic()).isEqualTo(3); } + @Test + public void testResolver(EmbeddedKafkaZKBroker broker) { + assertThat(broker).isNotNull(); + } + } From 6bc290ebbe527b30e2d3404cd6045d624e974e96 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Fri, 15 Dec 2023 09:34:12 -0500 Subject: [PATCH 3/4] Add `@author` --- .../kafka/test/condition/EmbeddedKafkaCondition.java | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-kafka-test/src/main/java/org/springframework/kafka/test/condition/EmbeddedKafkaCondition.java b/spring-kafka-test/src/main/java/org/springframework/kafka/test/condition/EmbeddedKafkaCondition.java index 364fc691e4..103f03668d 100644 --- a/spring-kafka-test/src/main/java/org/springframework/kafka/test/condition/EmbeddedKafkaCondition.java +++ b/spring-kafka-test/src/main/java/org/springframework/kafka/test/condition/EmbeddedKafkaCondition.java @@ -54,6 +54,7 @@ * @author Artem Bilan * @author Pawel Lozinski * @author Adrian Chlebosz + * @author Michał Padula * * @since 2.3 * From ef1bd4ec81e04fefa819ad18808b79a13e851ac8 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Fri, 15 Dec 2023 09:34:42 -0500 Subject: [PATCH 4/4] Add `@author` --- .../kafka/test/condition/EmbeddedKafkaConditionTests.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-kafka-test/src/test/java/org/springframework/kafka/test/condition/EmbeddedKafkaConditionTests.java b/spring-kafka-test/src/test/java/org/springframework/kafka/test/condition/EmbeddedKafkaConditionTests.java index 10452ce2f6..012d4222ba 100644 --- a/spring-kafka-test/src/test/java/org/springframework/kafka/test/condition/EmbeddedKafkaConditionTests.java +++ b/spring-kafka-test/src/test/java/org/springframework/kafka/test/condition/EmbeddedKafkaConditionTests.java @@ -27,6 +27,8 @@ /** * @author Gary Russell + * @author Michał Padula + * * @since 2.3 * */