diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfiguration.java index fd095bd432..c49273fd0d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfiguration.java @@ -207,7 +207,7 @@ public class JerseyAutoConfiguration implements ServletContextAware { }; } - @Configuration + @Configuration(proxyBeanMethods = false) @ConditionalOnClass({ JaxbAnnotationIntrospector.class, XmlElement.class }) static class JaxbObjectMapperCustomizer { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfigurationTests.java index 03c3c5d272..cfa2cda317 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/ElasticsearchDataAutoConfigurationTests.java @@ -109,31 +109,31 @@ class ElasticsearchDataAutoConfigurationTests { .contains("reactiveElasticsearchTemplate")); } - @Configuration + @Configuration(proxyBeanMethods = false) static class CustomTransportTemplate { @Bean - ElasticsearchTemplate elasticsearchTemplate() { + public ElasticsearchTemplate elasticsearchTemplate() { return mock(ElasticsearchTemplate.class); } } - @Configuration + @Configuration(proxyBeanMethods = false) static class CustomRestTemplate { @Bean - ElasticsearchRestTemplate elasticsearchTemplate() { + public ElasticsearchRestTemplate elasticsearchTemplate() { return mock(ElasticsearchRestTemplate.class); } } - @Configuration + @Configuration(proxyBeanMethods = false) static class CustomReactiveRestTemplate { @Bean - ReactiveElasticsearchTemplate reactiveElasticsearchTemplate() { + public ReactiveElasticsearchTemplate reactiveElasticsearchTemplate() { return mock(ReactiveElasticsearchTemplate.class); }