Updated versions and re-enabled kafka test
This commit is contained in:
@@ -26,6 +26,8 @@ import org.apache.kafka.clients.admin.NewTopic;
|
||||
import org.apache.kafka.clients.producer.Producer;
|
||||
import org.apache.kafka.clients.producer.ProducerRecord;
|
||||
import org.apache.kafka.common.serialization.StringSerializer;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.batch.core.Job;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
@@ -45,16 +47,17 @@ import org.springframework.kafka.core.DefaultKafkaProducerFactory;
|
||||
import org.springframework.kafka.support.serializer.JsonDeserializer;
|
||||
import org.springframework.kafka.support.serializer.JsonSerializer;
|
||||
import org.springframework.kafka.test.EmbeddedKafkaBroker;
|
||||
import org.springframework.kafka.test.context.EmbeddedKafka;
|
||||
import org.springframework.kafka.test.utils.KafkaTestUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
//@EmbeddedKafka(partitions = 1, topics = { "test" })
|
||||
@EmbeddedKafka(partitions = 1, topics = { "test" })
|
||||
public class KafkaItemReaderAutoConfigurationTests {
|
||||
|
||||
private static EmbeddedKafkaBroker embeddedKafkaBroker;
|
||||
|
||||
// @BeforeAll
|
||||
@BeforeAll
|
||||
public static void setupTest(EmbeddedKafkaBroker embeddedKafka) {
|
||||
embeddedKafkaBroker = embeddedKafka;
|
||||
embeddedKafka.addTopics(new NewTopic("topic1", 1, (short) 1),
|
||||
@@ -62,7 +65,7 @@ public class KafkaItemReaderAutoConfigurationTests {
|
||||
new NewTopic("topic3", 1, (short) 1));
|
||||
}
|
||||
|
||||
// @Test
|
||||
@Test
|
||||
public void testBaseKafkaItemReader() {
|
||||
final String topicName = "topic1";
|
||||
populateSingleTopic(topicName);
|
||||
@@ -109,7 +112,7 @@ public class KafkaItemReaderAutoConfigurationTests {
|
||||
});
|
||||
}
|
||||
|
||||
// @Test
|
||||
@Test
|
||||
public void testBaseKafkaItemReaderMultiplePartitions() {
|
||||
final String topicName = "topic2";
|
||||
populateSingleTopic(topicName);
|
||||
@@ -151,7 +154,7 @@ public class KafkaItemReaderAutoConfigurationTests {
|
||||
});
|
||||
}
|
||||
|
||||
// @Test
|
||||
@Test
|
||||
public void testBaseKafkaItemReaderPollTimeoutDefault() {
|
||||
final String topicName = "topic3";
|
||||
populateSingleTopic(topicName);
|
||||
|
||||
@@ -24,6 +24,8 @@ import java.util.Map;
|
||||
import org.apache.kafka.clients.consumer.Consumer;
|
||||
import org.apache.kafka.clients.consumer.ConsumerRecords;
|
||||
import org.apache.kafka.common.serialization.StringDeserializer;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.batch.core.Job;
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
@@ -43,23 +45,24 @@ import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
|
||||
import org.springframework.kafka.support.serializer.JsonDeserializer;
|
||||
import org.springframework.kafka.test.EmbeddedKafkaBroker;
|
||||
import org.springframework.kafka.test.context.EmbeddedKafka;
|
||||
import org.springframework.kafka.test.utils.KafkaTestUtils;
|
||||
|
||||
import static java.util.Collections.singleton;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
// @EmbeddedKafka(partitions = 1, topics = { "topic1" })
|
||||
@EmbeddedKafka(partitions = 1, topics = { "topic1" })
|
||||
public class KafkaItemWriterTests {
|
||||
|
||||
private static EmbeddedKafkaBroker embeddedKafkaBroker;
|
||||
|
||||
// @BeforeAll
|
||||
@BeforeAll
|
||||
public static void setupTest(EmbeddedKafkaBroker embeddedKafka) {
|
||||
embeddedKafkaBroker = embeddedKafka;
|
||||
embeddedKafka.addTopics("topic2");
|
||||
}
|
||||
|
||||
// @Test
|
||||
@Test
|
||||
public void testBaseKafkaItemWriter() {
|
||||
final String topicName = "topic1";
|
||||
ApplicationContextRunner applicationContextRunner = new ApplicationContextRunner()
|
||||
|
||||
Reference in New Issue
Block a user