Questions tagged [spring-kafka-test]
134 questions
0
votes
0 answers
@SpringBootTest - No qualifying bean of type 'com.my.app.KafkaProducerServiceTest$KafkaConsumerHelper'
I am writing a unit test that contains a component written inside the test class itself. But I get an error No qualifying bean of type 'com.my.app.KafkaProducerServiceTest$KafkaConsumerHelper' available: No resolvable resource object. I know it is…

ever alian
- 1,028
- 3
- 15
- 45
0
votes
1 answer
Could not autowire. No beans of 'EmbeddedKafkaBroker' type found
I am trying to write unit test for kafka producer. But I get an error - Could not autowire. No beans of 'EmbeddedKafkaBroker' type found. in the line lateinit var embeddedKafkaBroker: EmbeddedKafkaBroker
Here is my…

ever alian
- 1,028
- 3
- 15
- 45
0
votes
1 answer
Test onFailure of spring-kafka sending message
I try to test the onFailure case when I send a kafka message with producer but the onFailure method is never fire.
Here is my code where I send a message :
@Component
public class MessageSending {
@Autowired
Map

kasko
- 131
- 1
- 4
- 14
0
votes
0 answers
Embedded Kafka test cases not considered in test case execution
I have added EmbeddedKafka for testing purpose and introduced 3 more Kafka test cases. Total 8 test cases.
When I am running test cases from intellij all test cases are running as expected (all green) 8/8
While executing maven install or test…

StackOverFlow
- 4,486
- 12
- 52
- 87
0
votes
1 answer
Could not complete execution for Gradle Test Executor Spring Boot 3.0
Whenever adding spring-kafka-test as a dependency I cannot run tests.
Tests start to fail for following reason:
org.gradle.api.internal.tasks.testing.TestSuiteExecutionException: Could not complete execution for Gradle Test Executor 1.
at…

GROX13
- 4,605
- 4
- 27
- 41
0
votes
0 answers
How to add retries configuration in spring kafka producer?
I am working on kafka producer application in which I want to implement the retry functionality. Following is the config that I am using,
@Bean
public ProducerFactory producerFactory() {
return new…

Jayant Kokitkar
- 65
- 7
0
votes
1 answer
I cannot connect to kafka using a test container while the integration is writing a test
using testcontainer; I'm trying to write an integration test for my project with kafka, postgreSql and elasticsearch, but when I run docker-compose_v2.yml file and run my tests, my tests are successful, but when I use testcontainer, my tests fail, I…

Semih
- 5
- 4
0
votes
0 answers
Difference between "Kafka for junit" & "spring-kafka-test"
We are using spring boot application for Kafka.
We want to do unit testing & integration testing for Kafka producer(kafkatemplate) & consumer (EventListner) application.
We explored couple of library for Kafka testing.
#1 Test container/ Kafka…

StackOverFlow
- 4,486
- 12
- 52
- 87
0
votes
1 answer
Test Kafka consumer using EmbddedKafka fail when launching a batch of tests
I'm testing my Kafka Consumer in Spring Boot. My consumer are similar to the following
@Slf4j
@Component
@RequiredArgsConstructor
public class KafkaPaymentConsumer {
private final PaymentInterface paymentInterface;
@KafkaListener(topics =…

Smaillns
- 2,540
- 1
- 28
- 40
0
votes
1 answer
KafkaListener Not triggered in Spring Boot test
I have a spring boot test to check if a kafka consumer listens for a message in specific topic. The kafka listener is triggered when using @SpringBootTest. But I just don't want to load all the classes and I only supplied the listener class like…

tsadkan yitbarek
- 1,360
- 2
- 11
- 28
0
votes
0 answers
Embedded kafka-spring-test not working with kafka-clients 2.8.1
According to compatibility matrix https://spring.io/projects/spring-kafka kafka-spring-test v2.7.12 should work with kafka-clients 2.7.0 - 2.8.1 but I'm getting runtime exceptions during embedded kafka tests.
pom.xml
...
…

Remi
- 766
- 9
- 15
0
votes
1 answer
KafkaTestUtils.getRecords() or KafkaTestUtils.getSingleRecord() takes too long some times
I am testing a Spring-boot application that produces kafka messages, I have created a consumer in the tests to validate that we are sending the message properly. When I use KafkaTestUtils.getRecords() or KafkaTestUtils.getSingleRecord() in the test…

Jan Korwer
- 3
- 3
0
votes
1 answer
how to set adminTimeout value with @EmbeddedKafka Annotation (junit5)?
While using parallel gradle tests (org.gradle.parallel=true) to minimize overall test-execution time with junit5 and the @EmbeddedKafka annotation (I need to do integration-tests for > 20 different kafka-based micro-services; using parallel-testing…

user2038596
- 535
- 1
- 3
- 14
0
votes
1 answer
Embedded kafka with real classes communication
I have Spring Boot Application with using spring-kafka and spring-kafka-test. I have below MessageProducer.
@Component
public class MessageProducer {
private KafkaTemplate kafkaTemplate;
@Autowired
public…

ppb
- 2,299
- 4
- 43
- 75
0
votes
1 answer
Spring Boot Kafka Junit with application defined kafka server from docker compose
I have Spring Boot Application with docker-compose,from it I am configuring kafka and other required application.
I have Kafka Producer and Consumer (@kafkaListener) in my application. I have Kafka and JPA Repository configuration from @Bean (not…

ppb
- 2,299
- 4
- 43
- 75