|
36 | 36 | import org.apache.kafka.common.serialization.StringSerializer; |
37 | 37 | import org.junit.jupiter.api.Test; |
38 | 38 |
|
39 | | -import org.springframework.beans.factory.annotation.Autowired; |
40 | 39 | import org.springframework.kafka.test.EmbeddedKafkaBroker; |
41 | 40 | import org.springframework.kafka.test.context.EmbeddedKafka; |
42 | | -import org.springframework.test.annotation.DirtiesContext; |
43 | | -import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; |
44 | 41 |
|
45 | 42 | import static org.assertj.core.api.Assertions.assertThat; |
46 | 43 | import static org.assertj.core.api.Assertions.assertThatThrownBy; |
|
59 | 56 | "share.coordinator.state.topic.replication.factor=1", |
60 | 57 | "share.coordinator.state.topic.min.isr=1" |
61 | 58 | }) |
62 | | -@SpringJUnitConfig |
63 | | -@DirtiesContext |
64 | 59 | class DefaultShareConsumerFactoryTests { |
65 | 60 |
|
66 | | - @Autowired |
67 | | - private EmbeddedKafkaBroker embeddedKafka; |
68 | | - |
69 | 61 | @Test |
70 | 62 | void shouldInstantiateWithConfigs() { |
71 | 63 | Map<String, Object> configs = new HashMap<>(); |
@@ -152,10 +144,10 @@ void shouldReturnUnmodifiableListenersList() { |
152 | 144 | } |
153 | 145 |
|
154 | 146 | @Test |
155 | | - void integrationTestDefaultShareConsumerFactory() throws Exception { |
| 147 | + void integrationTestDefaultShareConsumerFactory(EmbeddedKafkaBroker broker) throws Exception { |
156 | 148 | final String topic = "embedded-share-test"; |
157 | 149 | final String groupId = "testGroup"; |
158 | | - var bootstrapServers = embeddedKafka.getBrokersAsString(); |
| 150 | + var bootstrapServers = broker.getBrokersAsString(); |
159 | 151 |
|
160 | 152 | var producerProps = new java.util.Properties(); |
161 | 153 | producerProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers); |
|
0 commit comments