December 14, 2020

No qualifying bean of type 'org.springframework.boot.test.web.client.TestRestTemplate' available: expected at least 1 bean which qualifies as autowire candidate

No qualifying bean of type 'org.springframework.boot.test.web.client.TestRestTemplate' available: expected at least 1 bean which qualifies as autowire candidate

2020-07-04 09:39:16.837 ERROR 1680 --- [           main] o.s.test.context.TestContextManager      : Caught exception while allowing TestExecutionListener [org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@1fdf1c5] to prepare test instance [com.fp.ordermanagementservice.OrderManagementServiceApplicationTests@3f6bfcbe]

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.fp.ordermanagementservice.OrderManagementServiceApplicationTests': Unsatisfied dependency expressed through field 'restTemplate'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.boot.test.web.client.TestRestTemplate' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

No comments:

Post a Comment

Your feedback may help others !!!

Facebook comments