Skip to content

Instantly share code, notes, and snippets.

@eddumelendez
Created May 17, 2023 14:49
Show Gist options
  • Save eddumelendez/127038ff31efc7030f943b5723bb82dd to your computer and use it in GitHub Desktop.
Save eddumelendez/127038ff31efc7030f943b5723bb82dd to your computer and use it in GitHub Desktop.
public class ConsumerApplicationTests {
public static void main(String[] args) {
SpringApplication.from(ConsumerApplication::main)
.with(ContainerConfiguration.class)
.run(args);
}
@TestConfiguration
static class ContainerConfiguration {
@Bean
@ServiceConnection
@RestartScope
KafkaContainer kafkaContainer() {
return new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka:7.3.0"))
.withReuse(true);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment