Spring boot testing of a rest client using @RestClientTest
问题 I am using spring boot 1.5.8 and want to test my client: @Component public class RestClientBean implements RestClient { private Map<String, RestTemplate> restTemplates = new HashMap<>(); @Autowired public RestClientBean(RestTemplateBuilder builder, SomeConfig conf) { restTemplates.put("first", builder.rootUri("first").build(); restTemplates.put("second", builder.rootUri("second").build(); } } with the following test: @RunWith(SpringRunner.class) @RestClientTest(RestClient.class) public class