remove redundant

This commit is contained in:
ggmaleva 2021-12-13 15:33:13 +03:00
parent 39279fffb3
commit 9d68e432ef
No known key found for this signature in database
GPG Key ID: 0E412B78565B108F

View File

@ -25,41 +25,16 @@ import java.util.Map;
@ExtendWith({KafkaContainerExtension.class, ElasticsearchContainerExtension.class})
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
@SpringBootTest
//@ContextConfiguration(initializers = AbstractIntegrationTest.Initializer.class)
public abstract class AbstractIntegrationTest {
private static final String TOPIC_NAME = "mg-events-party";
// private static final String CONFLUENT_PLATFORM_VERSION = "5.0.1";
//
// @ClassRule
// public static ElasticsearchContainer elastic =
// new ElasticsearchContainer("docker.elastic.co/elasticsearch/elasticsearch:7.8.0");
//
// @ClassRule
// public static KafkaContainer kafka = new KafkaContainer(CONFLUENT_PLATFORM_VERSION).withEmbeddedZookeeper();
@DynamicPropertySource
static void containersProps(DynamicPropertyRegistry registry) {
registry.add("kafka.bootstrap-servers", KafkaContainerExtension.KAFKA::getBootstrapServers);
registry.add("spring.elasticsearch.rest.uris",
ElasticsearchContainerExtension.ELASTIC_SEARCH::getHttpHostAddress);
}
//
// public static class Initializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
// @SneakyThrows
// @Override
// public void initialize(ConfigurableApplicationContext configurableApplicationContext) {
// TestPropertyValues
// .of("kafka.bootstrap-servers=" + kafka.getBootstrapServers(),
// "spring.elasticsearch.rest.uris=" + elastic.getHttpHostAddress())
// .applyTo(configurableApplicationContext.getEnvironment());
// }
// }
public static void sendMessage(SinkEvent sinkEvent) {
createProducer().send(new ProducerRecord<>(TOPIC_NAME, sinkEvent.getEvent().getSourceId(), sinkEvent));
}
public static void sendMessages(List<SinkEvent> sinkEvents) {
final Producer<String, SinkEvent> producer = createProducer();