Reduce need for bean method proxying and disable where not needed

Closes gh-9068
This commit is contained in:
Andy Wilkinson
2019-02-08 14:51:38 +00:00
parent 0f71f22f3c
commit 68bfb020aa
887 changed files with 2574 additions and 2542 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -80,7 +80,7 @@ public class AuditEventsEndpointWebIntegrationTests {
.isEqualTo(new JSONArray().appendElement("logout"));
}
@Configuration
@Configuration(proxyBeanMethods = false)
protected static class TestConfiguration {
@Bean
@@ -93,8 +93,9 @@ public class AuditEventsEndpointWebIntegrationTests {
}
@Bean
public AuditEventsEndpoint auditEventsEndpoint() {
return new AuditEventsEndpoint(auditEventsRepository());
public AuditEventsEndpoint auditEventsEndpoint(
AuditEventRepository auditEventRepository) {
return new AuditEventsEndpoint(auditEventRepository);
}
private AuditEvent createEvent(String instant, String principal, String type) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -110,7 +110,7 @@ public class BeansEndpointTests {
});
}
@Configuration
@Configuration(proxyBeanMethods = false)
public static class EndpointConfiguration {
@Bean
@@ -120,7 +120,7 @@ public class BeansEndpointTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class BeanConfiguration {
@Bean
@@ -130,7 +130,7 @@ public class BeansEndpointTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class LazyBeanConfiguration {
@Lazy

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -97,7 +97,7 @@ public class CachesEndpointWebIntegrationTests {
client.get().uri("/actuator/caches/a").exchange().expectStatus().isBadRequest();
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class TestConfiguration {
@Bean

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -94,7 +94,7 @@ public class ShutdownEndpointTests {
assertThat(childLatch.await(10, TimeUnit.SECONDS)).isTrue();
}
@Configuration
@Configuration(proxyBeanMethods = false)
public static class EndpointConfig {
private final CountDownLatch latch = new CountDownLatch(1);
@@ -118,7 +118,7 @@ public class ShutdownEndpointTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
public static class EmptyConfig {
private final CountDownLatch latch = new CountDownLatch(1);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -83,7 +83,7 @@ public class ConfigurationPropertiesReportEndpointMethodAnnotationsTests {
});
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties
public static class Config {
@@ -106,7 +106,7 @@ public class ConfigurationPropertiesReportEndpointMethodAnnotationsTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties
public static class OverriddenPrefix {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -84,7 +84,7 @@ public class ConfigurationPropertiesReportEndpointParentTests {
});
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties
public static class Parent {
@@ -95,7 +95,7 @@ public class ConfigurationPropertiesReportEndpointParentTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties
public static class ClassConfigurationProperties {
@@ -111,7 +111,7 @@ public class ConfigurationPropertiesReportEndpointParentTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties
public static class BeanMethodConfigurationProperties {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -62,7 +62,7 @@ public class ConfigurationPropertiesReportEndpointProxyTests {
});
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableTransactionManagement(proxyTargetClass = false)
@EnableConfigurationProperties
public static class Config {
@@ -73,8 +73,8 @@ public class ConfigurationPropertiesReportEndpointProxyTests {
}
@Bean
public PlatformTransactionManager transactionManager() {
return new DataSourceTransactionManager(dataSource());
public PlatformTransactionManager transactionManager(DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
@Bean

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -258,7 +258,7 @@ public class ConfigurationPropertiesReportEndpointSerializationTests {
});
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties
public static class Base {
@@ -269,7 +269,7 @@ public class ConfigurationPropertiesReportEndpointSerializationTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(Base.class)
public static class FooConfig {
@@ -281,7 +281,7 @@ public class ConfigurationPropertiesReportEndpointSerializationTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(Base.class)
public static class SelfReferentialConfig {
@@ -293,7 +293,7 @@ public class ConfigurationPropertiesReportEndpointSerializationTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(Base.class)
public static class MetadataCycleConfig {
@@ -305,7 +305,7 @@ public class ConfigurationPropertiesReportEndpointSerializationTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(Base.class)
public static class MapConfig {
@@ -317,7 +317,7 @@ public class ConfigurationPropertiesReportEndpointSerializationTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(Base.class)
public static class ListConfig {
@@ -329,7 +329,7 @@ public class ConfigurationPropertiesReportEndpointSerializationTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(Base.class)
public static class MetadataMapConfig {
@@ -341,7 +341,7 @@ public class ConfigurationPropertiesReportEndpointSerializationTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(Base.class)
public static class AddressedConfig {
@@ -353,7 +353,7 @@ public class ConfigurationPropertiesReportEndpointSerializationTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(Base.class)
public static class InitializedMapAndListPropertiesConfig {
@@ -508,7 +508,7 @@ public class ConfigurationPropertiesReportEndpointSerializationTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(Base.class)
static class CycleConfig {
@@ -521,7 +521,7 @@ public class ConfigurationPropertiesReportEndpointSerializationTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties
static class HikariDataSourceConfig {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -222,7 +222,7 @@ public class ConfigurationPropertiesReportEndpointTests {
});
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties
public static class Parent {
@@ -233,7 +233,7 @@ public class ConfigurationPropertiesReportEndpointTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties
public static class Config {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -151,8 +151,8 @@ public class EndpointDiscovererTests {
@Test
public void getEndpointsWhenEndpointsArePrefixedWithScopedTargetShouldRegisterOnlyOneEndpoint() {
load(ScopedTargetEndpointConfiguration.class, (context) -> {
TestEndpoint expectedEndpoint = context
.getBean(ScopedTargetEndpointConfiguration.class).testEndpoint();
TestEndpoint expectedEndpoint = context.getBean("testEndpoint",
TestEndpoint.class);
Collection<TestExposableEndpoint> endpoints = new TestEndpointDiscoverer(
context).getEndpoints();
assertThat(endpoints).flatExtracting(TestExposableEndpoint::getEndpointBean)
@@ -365,12 +365,12 @@ public class EndpointDiscovererTests {
}
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class EmptyConfiguration {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class TestEndpointConfiguration {
@Bean
@@ -380,7 +380,7 @@ public class EndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class TestEndpointSubclassConfiguration {
@Bean
@@ -390,7 +390,7 @@ public class EndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class ClashingEndpointConfiguration {
@Bean
@@ -405,7 +405,7 @@ public class EndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class ScopedTargetEndpointConfiguration {
@Bean

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -304,12 +304,12 @@ public class JmxEndpointDiscovererTests {
}
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class EmptyConfiguration {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class MultipleEndpointsConfiguration {
@Bean
@@ -329,7 +329,7 @@ public class JmxEndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class OverriddenOperationJmxEndpointConfiguration {
@Bean
@@ -344,7 +344,7 @@ public class JmxEndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class AdditionalOperationJmxEndpointConfiguration {
@Bean
@@ -359,7 +359,7 @@ public class JmxEndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class AdditionalClashingOperationsConfiguration {
@Bean
@@ -374,7 +374,7 @@ public class JmxEndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class ClashingJmxEndpointConfiguration {
@Bean
@@ -394,7 +394,7 @@ public class JmxEndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class ClashingStandardEndpointConfiguration {
@Bean
@@ -409,7 +409,7 @@ public class JmxEndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class InvalidJmxExtensionConfiguration {
@Bean

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -462,7 +462,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
}
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(BaseConfiguration.class)
protected static class TestEndpointConfiguration {
@@ -473,7 +473,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(BaseConfiguration.class)
static class QueryEndpointConfiguration {
@@ -484,7 +484,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(BaseConfiguration.class)
static class QueryWithListEndpointConfiguration {
@@ -495,7 +495,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(BaseConfiguration.class)
static class VoidWriteResponseEndpointConfiguration {
@@ -507,7 +507,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(BaseConfiguration.class)
static class VoidDeleteResponseEndpointConfiguration {
@@ -519,7 +519,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(BaseConfiguration.class)
static class NullWriteResponseEndpointConfiguration {
@@ -531,7 +531,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(BaseConfiguration.class)
static class NullReadResponseEndpointConfiguration {
@@ -542,7 +542,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(BaseConfiguration.class)
static class NullDeleteResponseEndpointConfiguration {
@@ -553,7 +553,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(BaseConfiguration.class)
protected static class ResourceEndpointConfiguration {
@@ -564,7 +564,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(BaseConfiguration.class)
static class ResourceWebEndpointResponseEndpointConfiguration {
@@ -575,7 +575,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(BaseConfiguration.class)
static class MonoResponseEndpointConfiguration {
@@ -586,7 +586,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(BaseConfiguration.class)
static class CustomMediaTypesEndpointConfiguration {
@@ -597,7 +597,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(BaseConfiguration.class)
static class RequiredParameterEndpointConfiguration {
@@ -608,7 +608,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(BaseConfiguration.class)
protected static class PrincipalEndpointConfiguration {
@@ -619,7 +619,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(BaseConfiguration.class)
protected static class PrincipalQueryEndpointConfiguration {
@@ -630,7 +630,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(BaseConfiguration.class)
protected static class SecurityContextEndpointConfiguration {
@@ -641,7 +641,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(BaseConfiguration.class)
protected static class UserInRoleEndpointConfiguration {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,7 +37,7 @@ import static org.mockito.Mockito.mock;
*
* @author Andy Wilkinson
*/
@Configuration
@Configuration(proxyBeanMethods = false)
class BaseConfiguration {
@Bean
@@ -63,11 +63,12 @@ class BaseConfiguration {
@Bean
public WebEndpointDiscoverer webEndpointDiscoverer(
EndpointMediaTypes endpointMediaTypes,
ApplicationContext applicationContext) {
ParameterValueMapper parameterMapper = new ConversionServiceParameterValueMapper(
DefaultConversionService.getSharedInstance());
return new WebEndpointDiscoverer(applicationContext, parameterMapper,
endpointMediaTypes(), null, Collections.emptyList(),
endpointMediaTypes, null, Collections.emptyList(),
Collections.emptyList());
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -157,12 +157,12 @@ public class ControllerEndpointDiscovererTests {
};
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class EmptyConfiguration {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import({ TestEndpoint.class, TestControllerEndpoint.class,
TestRestControllerEndpoint.class })
static class WithRegularEndpointConfiguration {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -156,12 +156,12 @@ public class ServletEndpointDiscovererTests {
};
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class EmptyConfiguration {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import({ TestEndpoint.class, TestServletEndpoint.class })
static class WithRegularEndpointConfiguration {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -301,12 +301,12 @@ public class WebEndpointDiscovererTests {
return new RequestPredicateMatcher(path);
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class EmptyConfiguration {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class MultipleEndpointsConfiguration {
@Bean
@@ -321,7 +321,7 @@ public class WebEndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class TestWebEndpointExtensionConfiguration {
@Bean
@@ -331,7 +331,7 @@ public class WebEndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class ClashingOperationsEndpointConfiguration {
@Bean
@@ -341,7 +341,7 @@ public class WebEndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class ClashingOperationsWebEndpointExtensionConfiguration {
@Bean
@@ -351,7 +351,7 @@ public class WebEndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(TestEndpointConfiguration.class)
static class OverriddenOperationWebEndpointExtensionConfiguration {
@@ -362,7 +362,7 @@ public class WebEndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(TestEndpointConfiguration.class)
static class AdditionalOperationWebEndpointConfiguration {
@@ -373,7 +373,7 @@ public class WebEndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class TestEndpointConfiguration {
@Bean
@@ -383,7 +383,7 @@ public class WebEndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class ClashingWebEndpointConfiguration {
@Bean
@@ -403,7 +403,7 @@ public class WebEndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class ClashingStandardEndpointConfiguration {
@Bean
@@ -418,7 +418,7 @@ public class WebEndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class ClashingSelectorsWebEndpointExtensionConfiguration {
@Bean
@@ -433,7 +433,7 @@ public class WebEndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class InvalidWebExtensionConfiguration {
@Bean
@@ -448,7 +448,7 @@ public class WebEndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class VoidWriteOperationEndpointConfiguration {
@Bean
@@ -458,7 +458,7 @@ public class WebEndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(BaseConfiguration.class)
static class ResourceEndpointConfiguration {
@@ -469,7 +469,7 @@ public class WebEndpointDiscovererTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import(BaseConfiguration.class)
static class CustomMediaTypesEndpointConfiguration {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -90,7 +90,7 @@ public class JerseyWebEndpointIntegrationTests extends
// Jersey doesn't support the general error page handling
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class JerseyConfiguration {
@Bean
@@ -124,7 +124,7 @@ public class JerseyWebEndpointIntegrationTests extends
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class AuthenticatedConfiguration {
@Bean

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -108,7 +108,7 @@ public class ControllerEndpointHandlerMappingIntegrationTests {
.responseTimeout(Duration.ofMinutes(2)).build();
}
@Configuration
@Configuration(proxyBeanMethods = false)
@ImportAutoConfiguration({ JacksonAutoConfiguration.class,
HttpMessageConvertersAutoConfiguration.class,
WebFluxAutoConfiguration.class })

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -102,7 +102,7 @@ public class WebFluxEndpointIntegrationTests extends
return context.getBean(ReactiveConfiguration.class).port;
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableWebFlux
@ImportAutoConfiguration(ErrorWebFluxAutoConfiguration.class)
static class ReactiveConfiguration {
@@ -140,7 +140,7 @@ public class WebFluxEndpointIntegrationTests extends
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class AuthenticatedConfiguration {
@Bean

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -107,7 +107,7 @@ public class ControllerEndpointHandlerMappingIntegrationTests {
.responseTimeout(Duration.ofMinutes(2)).build();
}
@Configuration
@Configuration(proxyBeanMethods = false)
@ImportAutoConfiguration({ JacksonAutoConfiguration.class,
HttpMessageConvertersAutoConfiguration.class, WebMvcAutoConfiguration.class,
DispatcherServletAutoConfiguration.class })

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -132,7 +132,7 @@ public class MvcWebEndpointIntegrationTests extends
return context.getWebServer().getPort();
}
@Configuration
@Configuration(proxyBeanMethods = false)
@ImportAutoConfiguration({ JacksonAutoConfiguration.class,
HttpMessageConvertersAutoConfiguration.class,
ServletWebServerFactoryAutoConfiguration.class, WebMvcAutoConfiguration.class,
@@ -160,7 +160,7 @@ public class MvcWebEndpointIntegrationTests extends
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class AuthenticatedConfiguration {
@Bean

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -68,7 +68,7 @@ class JerseyEndpointsRunner extends AbstractWebEndpointRunner {
return context;
}
@Configuration
@Configuration(proxyBeanMethods = false)
@ImportAutoConfiguration({ JacksonAutoConfiguration.class,
JerseyAutoConfiguration.class })
static class JerseyEndpointConfiguration {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -67,7 +67,7 @@ class WebFluxEndpointsRunner extends AbstractWebEndpointRunner {
return context;
}
@Configuration
@Configuration(proxyBeanMethods = false)
@ImportAutoConfiguration({ JacksonAutoConfiguration.class,
WebFluxAutoConfiguration.class })
static class WebFluxEndpointConfiguration
@@ -75,6 +75,8 @@ class WebFluxEndpointsRunner extends AbstractWebEndpointRunner {
private final ApplicationContext applicationContext;
private final PortHolder portHolder = new PortHolder();
WebFluxEndpointConfiguration(ApplicationContext applicationContext) {
this.applicationContext = applicationContext;
}
@@ -86,12 +88,12 @@ class WebFluxEndpointsRunner extends AbstractWebEndpointRunner {
@Bean
public PortHolder portHolder() {
return new PortHolder();
return this.portHolder;
}
@Override
public void onApplicationEvent(WebServerInitializedEvent event) {
portHolder().setPort(event.getWebServer().getPort());
this.portHolder.setPort(event.getWebServer().getPort());
}
@Bean

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -65,7 +65,7 @@ class WebMvcEndpointRunner extends AbstractWebEndpointRunner {
return context;
}
@Configuration
@Configuration(proxyBeanMethods = false)
@ImportAutoConfiguration({ JacksonAutoConfiguration.class,
HttpMessageConvertersAutoConfiguration.class, WebMvcAutoConfiguration.class,
DispatcherServletAutoConfiguration.class })

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -336,7 +336,7 @@ public class EnvironmentEndpointTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties
static class Config {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -135,7 +135,7 @@ public class EnvironmentEndpointWebIntegrationTests {
return "propertySources[?(@.name=='" + source + "')].property.value";
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class TestConfiguration {
@Bean

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -68,7 +68,7 @@ public class FlywayEndpointTests {
});
}
@Configuration
@Configuration(proxyBeanMethods = false)
@Import({ EmbeddedDataSourceConfiguration.class, FlywayAutoConfiguration.class })
public static class Config {
@@ -79,7 +79,7 @@ public class FlywayEndpointTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
public static class BaselinedFlywayConfig {
@SuppressWarnings("deprecation")

View File

@@ -155,7 +155,7 @@ public class HealthEndpointWebIntegrationTests {
}
}
@Configuration
@Configuration(proxyBeanMethods = false)
public static class TestConfiguration {
@Bean

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,13 +16,14 @@
package org.springframework.boot.actuate.info;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.stream.Collectors;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.actuate.endpoint.web.test.WebEndpointRunners;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -52,12 +53,13 @@ public class InfoEndpointWebIntegrationTests {
.jsonPath("beanName2.key22").isEqualTo("value22");
}
@Configuration
@Configuration(proxyBeanMethods = false)
public static class TestConfiguration {
@Bean
public InfoEndpoint endpoint() {
return new InfoEndpoint(Arrays.asList(beanName1(), beanName2()));
public InfoEndpoint endpoint(ObjectProvider<InfoContributor> infoContributors) {
return new InfoEndpoint(
infoContributors.orderedStream().collect(Collectors.toList()));
}
@Bean

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ public class IntegrationGraphEndpointWebIntegrationTests {
.exchange().expectStatus().isNoContent();
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableIntegration
public static class TestConfiguration {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -83,7 +83,7 @@ public class LiquibaseEndpointTests {
}
}
@Configuration
@Configuration(proxyBeanMethods = false)
public static class Config {
@Bean

View File

@@ -80,7 +80,7 @@ public class LogFileWebEndpointWebIntegrationTests {
.expectStatus().isOk().expectBody(String.class).isEqualTo("--TEST--");
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class TestConfiguration {
@Bean

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -161,7 +161,7 @@ public class LoggersEndpointWebIntegrationTests {
return array;
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class TestConfiguration {
@Bean

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -80,7 +80,7 @@ public class HeapDumpWebEndpointWebIntegrationTests {
assertThat(this.endpoint.file.exists()).isFalse();
}
@Configuration
@Configuration(proxyBeanMethods = false)
public static class TestConfiguration {
@Bean

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -76,7 +76,7 @@ public class MetricsEndpointWebIntegrationTests {
.isEqualTo("jvm.memory.used");
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class TestConfiguration {
@Bean

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,7 +47,7 @@ public class PrometheusScrapeEndpointIntegrationTests {
.contentType(MediaType.parseMediaType(TextFormat.CONTENT_TYPE_004));
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class TestConfiguration {
@Bean

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -55,7 +55,7 @@ public class DataSourcePoolMetricsTests {
});
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class MetricsApp {
@Bean
@@ -65,7 +65,7 @@ public class DataSourcePoolMetricsTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class DataSourceConfig {
DataSourceConfig(DataSource dataSource,

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -119,7 +119,7 @@ public class LongTaskTimingHandlerInterceptorTests {
.longTaskTimer().activeTasks()).isEqualTo(0);
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableWebMvc
@Import(Controller1.class)
static class MetricsInterceptorConfiguration {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -77,7 +77,7 @@ public class WebMvcMetricsFilterAutoTimedTests {
.count()).isEqualTo(1L);
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableWebMvc
@Import({ Controller.class })
static class TestConfiguration {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -298,7 +298,7 @@ public class WebMvcMetricsFilterTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableWebMvc
@Import({ Controller1.class, Controller2.class })
static class MetricsFilterApp {

View File

@@ -93,7 +93,7 @@ public class WebMvcMetricsIntegrationTests {
.isEqualTo(1L);
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableWebMvc
static class TestConfiguration {
@@ -114,7 +114,7 @@ public class WebMvcMetricsIntegrationTests {
"http.server.requests", true);
}
@Configuration
@Configuration(proxyBeanMethods = false)
@RestController
@RequestMapping("/api")
@Timed

View File

@@ -167,7 +167,7 @@ public class ScheduledTasksEndpointTests {
.accept(context.getBean(ScheduledTasksEndpoint.class).scheduledTasks()));
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableScheduling
static class BaseConfiguration {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -84,7 +84,7 @@ public class SessionsEndpointWebIntegrationTests {
.expectStatus().isNotFound();
}
@Configuration
@Configuration(proxyBeanMethods = false)
protected static class TestConfiguration {
@Bean

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -92,7 +92,7 @@ public class HttpTraceWebFilterIntegrationTests {
});
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableWebFlux
static class Config {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -170,7 +170,7 @@ public class MappingsEndpointTests {
return (T) contextMappings.getMappings().get(key);
}
@Configuration
@Configuration(proxyBeanMethods = false)
static class EndpointConfiguration {
@Bean
@@ -182,7 +182,7 @@ public class MappingsEndpointTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableWebFlux
@Controller
static class ReactiveWebConfiguration {
@@ -205,7 +205,7 @@ public class MappingsEndpointTests {
}
@Configuration
@Configuration(proxyBeanMethods = false)
@EnableWebMvc
@Controller
static class ServletWebConfiguration {
@@ -259,7 +259,7 @@ public class MappingsEndpointTests {
@Bean
public ServletRegistrationBean<DispatcherServlet> anotherDispatcherServletRegistration(
WebApplicationContext context) {
DispatcherServlet dispatcherServlet, WebApplicationContext context) {
ServletRegistrationBean<DispatcherServlet> registrationBean = new ServletRegistrationBean<>(
anotherDispatcherServlet(context));
registrationBean.setName("anotherDispatcherServletRegistration");