spring-cloud-samples/spring-cloud-contract-samples

Unable to execute producer tests kafka

prapurna-manda opened this issue · 0 comments

I am trying to execute kafka contract tests using SCC.
I keep running into this error :
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contractVerifierKafkaMessageExchange' defined in class path resource [org/springframework/cloud/contract/verifier/messaging/kafka/ContractVerifierKafkaConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.contract.verifier.messaging.MessageVerifier]: Factory method 'contractVerifierKafkaMessageExchange' threw exception; nested exception is java.lang.NullPointerException: Cannot invoke "org.springframework.boot.autoconfigure.kafka.KafkaProperties$Consumer.getGroupId()" because the return value of "org.springframework.boot.autoconfigure.kafka.KafkaProperties.getConsumer()" is null at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.22.jar:5.3.22] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.22.jar:5.3.22]

My Test looks like this :
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = KafkaEmployeeEventPublisher.class) @AutoConfigureMessageVerifier @EmbeddedKafka(partitions = 1, topics = {"test.topic"}) @ActiveProfiles("test") public abstract class BaseClassTest {

I am using spring-kafka.