I am using @KafkaListener in my application that's why I am using
@Configuration
static class ContextConfiguration {
//create the beans
}
My class using @Autowired @Qualifier("someName") for configuration while writing test class configuration which is Qualified with "someName" not loading..
so that it's throwing below error
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.web.client.RestTemplate'
available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=someName)}
In such case main problem is @Bean("someName") not loading in spring container so while create the bean, hack the configuration which is return under @Bean("someName") for ex..