Skip to content

Unable to execute producer tests kafka #392

Description

@prapurna-manda

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions