Commit 4b7e53e
authored
GH-2927: Subclasses for EmbeddedKafkaBroker param
Fixes: #2927
Starting a test without spring context with Embeded Lafka without `kraft` enabled and `EmbeddedKafkaZKBroker` as a test's parameter results in an exception:
```
No ParameterResolver registered for parameter [org.springframework.kafka.test.EmbeddedKafkaZKBroker broker] in method [public void test.SomeTest.test(org.springframework.kafka.test.EmbeddedKafkaZKBroker)].
org.junit.jupiter.api.extension.ParameterResolutionException: No ParameterResolver registered for parameter [org.springframework.kafka.test.EmbeddedKafkaZKBroker broker] in method [public void test.SomeTest.test(org.springframework.kafka.test.EmbeddedKafkaZKBroker)].
```
For test config:
```
@test
public void test(EmbeddedKafkaZKBroker broker)
```
* Fix `EmbeddedKafkaCondition` to use `EmbeddedKafkaBroker.class.isAssignableFrom(parameterContext.getParameter().getType());` instead of just `parameterContext.getParameter().getType().equals(EmbeddedKafkaBroker.class)`1 parent 7805541 commit 4b7e53e
File tree
2 files changed
+10
-1
lines changed- spring-kafka-test/src
- main/java/org/springframework/kafka/test/condition
- test/java/org/springframework/kafka/test/condition
2 files changed
+10
-1
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
44 | 52 | | |
0 commit comments