We are using spring boot version 1.5.2.RELEASE and Spring Cloud Sleuth version 1.1.2.RELEASE
I am Autowiring Tracer in my service class.
@Autowired
Tracer tracer
When running the application then everything is working fine. Tracer dependency gets injected properly
But when I am running spring mvc junit test cases then unit test cases are failing
Exception :
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.cloud.sleuth.Tracer' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)
I have searched for it but haven't found any relevant answers.
Kindly help.
following are the cloud dependecies:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<dependencyManagement>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Camden.SR5</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencyManagement>
PS: I cannot upgrade the spring boot version because of some client limitations.