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..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 * @@ -72,7 +73,7 @@ public boolean supportsParameter(ParameterContext parameterContext, ExtensionCon return false; } else { - return parameterContext.getParameter().getType().equals(EmbeddedKafkaBroker.class); + return EmbeddedKafkaBroker.class.isAssignableFrom(parameterContext.getParameter().getType()); } } 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..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 @@ -21,11 +21,14 @@ 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; /** * @author Gary Russell + * @author Michał Padula + * * @since 2.3 * */ @@ -41,4 +44,9 @@ public void test(EmbeddedKafkaBroker broker) { assertThat(broker.getPartitionsPerTopic()).isEqualTo(3); } + @Test + public void testResolver(EmbeddedKafkaZKBroker broker) { + assertThat(broker).isNotNull(); + } + }