JUnit
TestCase
Spring Boot
Add annotation of
@AutoConfigureWebClient
to your test case.
org.springframework.boot.test.autoconfigure.web.client.AutoConfigureWebClient
Together with
@ContextConfiguration(classes = {LocalConfig.class})
org.springframework.test.context.ContextConfiguration
public class LocalConfig {/****/public LocalConfig() {}@Beanpublic RestTemplate restTemplate(RestTemplateBuilder builder) {// Do any additional configuration herereturn builder.build();}}
to resolve this.
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.boot.web.client.RestTemplateBuilder' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.boot.web.client.RestTemplateBuilder' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
No comments:
Post a Comment