Commit 1f417997 authored by Phillip Webb's avatar Phillip Webb

Merge branch '1.5.x'

parents f03da0b4 d15f3548
...@@ -93,6 +93,7 @@ public class CacheStatisticsAutoConfiguration { ...@@ -93,6 +93,7 @@ public class CacheStatisticsAutoConfiguration {
public HazelcastCacheStatisticsProvider hazelcastCacheStatisticsProvider() { public HazelcastCacheStatisticsProvider hazelcastCacheStatisticsProvider() {
return new HazelcastCacheStatisticsProvider(); return new HazelcastCacheStatisticsProvider();
} }
} }
@Configuration @Configuration
......
...@@ -83,4 +83,5 @@ public class EndpointMBeanExportProperties { ...@@ -83,4 +83,5 @@ public class EndpointMBeanExportProperties {
public void setStaticNames(String[] staticNames) { public void setStaticNames(String[] staticNames) {
this.staticNames = StringUtils.splitArrayElementsIntoProperties(staticNames, "="); this.staticNames = StringUtils.splitArrayElementsIntoProperties(staticNames, "=");
} }
} }
...@@ -266,6 +266,7 @@ public class EndpointWebMvcAutoConfiguration ...@@ -266,6 +266,7 @@ public class EndpointWebMvcAutoConfiguration
@Conditional(OnManagementMvcCondition.class) @Conditional(OnManagementMvcCondition.class)
@Import(ManagementContextConfigurationsImportSelector.class) @Import(ManagementContextConfigurationsImportSelector.class)
protected static class EndpointWebMvcConfiguration { protected static class EndpointWebMvcConfiguration {
} }
/** /**
......
...@@ -43,4 +43,5 @@ public class JolokiaProperties { ...@@ -43,4 +43,5 @@ public class JolokiaProperties {
public void setConfig(Map<String, String> config) { public void setConfig(Map<String, String> config) {
this.config = config; this.config = config;
} }
} }
...@@ -126,6 +126,7 @@ public class ManagementWebSecurityAutoConfiguration { ...@@ -126,6 +126,7 @@ public class ManagementWebSecurityAutoConfiguration {
} }
} }
} }
@Configuration @Configuration
...@@ -158,6 +159,7 @@ public class ManagementWebSecurityAutoConfiguration { ...@@ -158,6 +159,7 @@ public class ManagementWebSecurityAutoConfiguration {
@Conditional(WebSecurityEnablerCondition.class) @Conditional(WebSecurityEnablerCondition.class)
@EnableWebSecurity @EnableWebSecurity
protected static class WebSecurityEnabler extends AuthenticationManagerConfiguration { protected static class WebSecurityEnabler extends AuthenticationManagerConfiguration {
} }
/** /**
......
...@@ -67,7 +67,6 @@ import org.springframework.messaging.MessageChannel; ...@@ -67,7 +67,6 @@ import org.springframework.messaging.MessageChannel;
* @see MetricWriter * @see MetricWriter
* @see InMemoryMetricRepository * @see InMemoryMetricRepository
* @see Exporter * @see Exporter
*
* @author Dave Syer * @author Dave Syer
*/ */
@Configuration @Configuration
...@@ -108,6 +107,7 @@ public class MetricRepositoryAutoConfiguration { ...@@ -108,6 +107,7 @@ public class MetricRepositoryAutoConfiguration {
public BufferGaugeService gaugeService(GaugeBuffers writer) { public BufferGaugeService gaugeService(GaugeBuffers writer) {
return new BufferGaugeService(writer); return new BufferGaugeService(writer);
} }
} }
} }
...@@ -145,7 +145,8 @@ final class MetricsFilter extends OncePerRequestFilter { ...@@ -145,7 +145,8 @@ final class MetricsFilter extends OncePerRequestFilter {
suffix); suffix);
} }
private String determineMetricNameSuffix(HttpServletRequest request, String path, int status) { private String determineMetricNameSuffix(HttpServletRequest request, String path,
int status) {
Object bestMatchingPattern = request Object bestMatchingPattern = request
.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE); .getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE);
if (bestMatchingPattern != null) { if (bestMatchingPattern != null) {
......
...@@ -101,7 +101,6 @@ public class CloudFoundryActuatorAutoConfiguration { ...@@ -101,7 +101,6 @@ public class CloudFoundryActuatorAutoConfiguration {
/** /**
* Nested configuration for ignored requests if Spring Security is present. * Nested configuration for ignored requests if Spring Security is present.
*
*/ */
@ConditionalOnClass(WebSecurity.class) @ConditionalOnClass(WebSecurity.class)
static class CloudFoundryIgnoredRequestConfiguration { static class CloudFoundryIgnoredRequestConfiguration {
......
...@@ -59,4 +59,5 @@ public class BeansEndpoint extends AbstractEndpoint<List<Object>> ...@@ -59,4 +59,5 @@ public class BeansEndpoint extends AbstractEndpoint<List<Object>>
public List<Object> invoke() { public List<Object> invoke() {
return this.parser.parseList(this.liveBeansView.getSnapshotAsJson()); return this.parser.parseList(this.liveBeansView.getSnapshotAsJson());
} }
} }
...@@ -332,6 +332,7 @@ public class ConfigurationPropertiesReportEndpoint ...@@ -332,6 +332,7 @@ public class ConfigurationPropertiesReportEndpoint
} }
return setter; return setter;
} }
} }
} }
...@@ -93,4 +93,5 @@ public class HealthEndpoint extends AbstractEndpoint<Health> { ...@@ -93,4 +93,5 @@ public class HealthEndpoint extends AbstractEndpoint<Health> {
} }
return name; return name;
} }
} }
...@@ -47,4 +47,5 @@ public class TraceEndpoint extends AbstractEndpoint<List<Trace>> { ...@@ -47,4 +47,5 @@ public class TraceEndpoint extends AbstractEndpoint<List<Trace>> {
public List<Trace> invoke() { public List<Trace> invoke() {
return this.repository.findAll(); return this.repository.findAll();
} }
} }
...@@ -47,4 +47,5 @@ public class ShutdownEndpointMBean extends EndpointMBean { ...@@ -47,4 +47,5 @@ public class ShutdownEndpointMBean extends EndpointMBean {
public Object shutdown() { public Object shutdown() {
return convert(getEndpoint().invoke()); return convert(getEndpoint().invoke());
} }
} }
...@@ -58,4 +58,5 @@ public class HalJsonMvcEndpoint extends AbstractNamedMvcEndpoint { ...@@ -58,4 +58,5 @@ public class HalJsonMvcEndpoint extends AbstractNamedMvcEndpoint {
protected final ManagementServletContext getManagementServletContext() { protected final ManagementServletContext getManagementServletContext() {
return this.managementServletContext; return this.managementServletContext;
} }
} }
...@@ -45,8 +45,8 @@ import org.springframework.web.util.UrlPathHelper; ...@@ -45,8 +45,8 @@ import org.springframework.web.util.UrlPathHelper;
*/ */
@ConfigurationProperties(prefix = "endpoints.jolokia", ignoreUnknownFields = false) @ConfigurationProperties(prefix = "endpoints.jolokia", ignoreUnknownFields = false)
@HypermediaDisabled @HypermediaDisabled
public class JolokiaMvcEndpoint extends AbstractNamedMvcEndpoint public class JolokiaMvcEndpoint extends AbstractNamedMvcEndpoint implements
implements InitializingBean, ApplicationContextAware, ServletContextAware, DisposableBean { InitializingBean, ApplicationContextAware, ServletContextAware, DisposableBean {
private final ServletWrappingController controller = new ServletWrappingController(); private final ServletWrappingController controller = new ServletWrappingController();
...@@ -116,6 +116,7 @@ public class JolokiaMvcEndpoint extends AbstractNamedMvcEndpoint ...@@ -116,6 +116,7 @@ public class JolokiaMvcEndpoint extends AbstractNamedMvcEndpoint
} }
return value; return value;
} }
} }
} }
...@@ -49,4 +49,5 @@ public class ShutdownMvcEndpoint extends EndpointMvcAdapter { ...@@ -49,4 +49,5 @@ public class ShutdownMvcEndpoint extends EndpointMvcAdapter {
} }
return super.invoke(); return super.invoke();
} }
} }
...@@ -50,4 +50,5 @@ public abstract class AbstractHealthIndicator implements HealthIndicator { ...@@ -50,4 +50,5 @@ public abstract class AbstractHealthIndicator implements HealthIndicator {
* system status. * system status.
*/ */
protected abstract void doHealthCheck(Health.Builder builder) throws Exception; protected abstract void doHealthCheck(Health.Builder builder) throws Exception;
} }
...@@ -61,4 +61,5 @@ public class DiskSpaceHealthIndicator extends AbstractHealthIndicator { ...@@ -61,4 +61,5 @@ public class DiskSpaceHealthIndicator extends AbstractHealthIndicator {
.withDetail("free", diskFreeInBytes) .withDetail("free", diskFreeInBytes)
.withDetail("threshold", this.properties.getThreshold()); .withDetail("threshold", this.properties.getThreshold());
} }
} }
...@@ -299,6 +299,7 @@ public final class Health { ...@@ -299,6 +299,7 @@ public final class Health {
public Health build() { public Health build() {
return new Health(this); return new Health(this);
} }
} }
} }
...@@ -42,4 +42,5 @@ public interface HealthAggregator { ...@@ -42,4 +42,5 @@ public interface HealthAggregator {
* @return the aggregated health * @return the aggregated health
*/ */
Health aggregate(Map<String, Health> healths); Health aggregate(Map<String, Health> healths);
} }
...@@ -167,6 +167,7 @@ public class DropwizardMetricServices implements CounterService, GaugeService { ...@@ -167,6 +167,7 @@ public class DropwizardMetricServices implements CounterService, GaugeService {
public void setValue(double value) { public void setValue(double value) {
this.value = value; this.value = value;
} }
} }
} }
...@@ -240,4 +240,5 @@ public class MetricCopyExporter extends AbstractMetricExporter { ...@@ -240,4 +240,5 @@ public class MetricCopyExporter extends AbstractMetricExporter {
} }
}; };
} }
...@@ -90,7 +90,6 @@ public class OpenTsdbGaugeWriter implements GaugeWriter { ...@@ -90,7 +90,6 @@ public class OpenTsdbGaugeWriter implements GaugeWriter {
/** /**
* Creates a new {@code OpenTsdbGaugeWriter} with the given millisecond * Creates a new {@code OpenTsdbGaugeWriter} with the given millisecond
* {@code connectTimeout} and {@code readTimeout}. * {@code connectTimeout} and {@code readTimeout}.
*
* @param connectTimeout the connect timeout in milliseconds * @param connectTimeout the connect timeout in milliseconds
* @param readTimeout the read timeout in milliseconds * @param readTimeout the read timeout in milliseconds
*/ */
......
...@@ -58,7 +58,6 @@ public class RedisMetricRepository implements MetricRepository { ...@@ -58,7 +58,6 @@ public class RedisMetricRepository implements MetricRepository {
* Create a RedisMetricRepository with a default prefix to apply to all metric names. * Create a RedisMetricRepository with a default prefix to apply to all metric names.
* If multiple repositories share a redis instance they will feed into the same global * If multiple repositories share a redis instance they will feed into the same global
* metrics. * metrics.
*
* @param redisConnectionFactory the redis connection factory * @param redisConnectionFactory the redis connection factory
*/ */
public RedisMetricRepository(RedisConnectionFactory redisConnectionFactory) { public RedisMetricRepository(RedisConnectionFactory redisConnectionFactory) {
...@@ -70,7 +69,6 @@ public class RedisMetricRepository implements MetricRepository { ...@@ -70,7 +69,6 @@ public class RedisMetricRepository implements MetricRepository {
* unique to this repository or to a logical repository contributed to by multiple * unique to this repository or to a logical repository contributed to by multiple
* instances, where they all see the same values). Recommended constructor for general * instances, where they all see the same values). Recommended constructor for general
* purpose use. * purpose use.
*
* @param redisConnectionFactory the redis connection factory * @param redisConnectionFactory the redis connection factory
* @param prefix the prefix to set for all metrics keys * @param prefix the prefix to set for all metrics keys
*/ */
...@@ -84,7 +82,6 @@ public class RedisMetricRepository implements MetricRepository { ...@@ -84,7 +82,6 @@ public class RedisMetricRepository implements MetricRepository {
* redis store will hold a zset under the key just so the metric names can be * redis store will hold a zset under the key just so the metric names can be
* enumerated. Read operations, especially {@link #findAll()} and {@link #count()}, * enumerated. Read operations, especially {@link #findAll()} and {@link #count()},
* will only be accurate if the key is unique to the prefix of this repository. * will only be accurate if the key is unique to the prefix of this repository.
*
* @param redisConnectionFactory the redis connection factory * @param redisConnectionFactory the redis connection factory
* @param prefix the prefix to set for all metrics keys * @param prefix the prefix to set for all metrics keys
* @param key the key to set * @param key the key to set
......
...@@ -51,4 +51,5 @@ final class RedisUtils { ...@@ -51,4 +51,5 @@ final class RedisUtils {
RedisConnectionFactory redisConnectionFactory) { RedisConnectionFactory redisConnectionFactory) {
return new StringRedisTemplate(redisConnectionFactory); return new StringRedisTemplate(redisConnectionFactory);
} }
} }
...@@ -78,4 +78,5 @@ public class InMemoryRichGaugeRepository implements RichGaugeRepository { ...@@ -78,4 +78,5 @@ public class InMemoryRichGaugeRepository implements RichGaugeRepository {
public long count() { public long count() {
return this.repository.count(); return this.repository.count();
} }
} }
...@@ -99,6 +99,7 @@ public class SimpleInMemoryRepository<T> { ...@@ -99,6 +99,7 @@ public class SimpleInMemoryRepository<T> {
/** /**
* Callback used to update a value. * Callback used to update a value.
*
* @param <T> the value type * @param <T> the value type
*/ */
public interface Callback<T> { public interface Callback<T> {
......
...@@ -64,8 +64,8 @@ public class AuthorizationAuditListener extends AbstractAuthorizationAuditListen ...@@ -64,8 +64,8 @@ public class AuthorizationAuditListener extends AbstractAuthorizationAuditListen
if (event.getAuthentication().getDetails() != null) { if (event.getAuthentication().getDetails() != null) {
data.put("details", event.getAuthentication().getDetails()); data.put("details", event.getAuthentication().getDetails());
} }
publish(new AuditEvent(event.getAuthentication().getName(), publish(new AuditEvent(event.getAuthentication().getName(), AUTHORIZATION_FAILURE,
AUTHORIZATION_FAILURE, data)); data));
} }
} }
...@@ -101,6 +101,7 @@ public class AuditAutoConfigurationTests { ...@@ -101,6 +101,7 @@ public class AuditAutoConfigurationTests {
} }
public static class TestAuditEventRepository extends InMemoryAuditEventRepository { public static class TestAuditEventRepository extends InMemoryAuditEventRepository {
} }
@Configuration @Configuration
......
...@@ -558,6 +558,7 @@ public class HealthIndicatorAutoConfigurationTests { ...@@ -558,6 +558,7 @@ public class HealthIndicatorAutoConfigurationTests {
public JestClient jestClient() { public JestClient jestClient() {
return mock(JestClient.class); return mock(JestClient.class);
} }
} }
} }
...@@ -274,11 +274,13 @@ public class ManagementWebSecurityAutoConfigurationTests { ...@@ -274,11 +274,13 @@ public class ManagementWebSecurityAutoConfigurationTests {
@EnableGlobalAuthentication @EnableGlobalAuthentication
@Configuration @Configuration
static class AuthenticationConfig { static class AuthenticationConfig {
@Autowired @Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().withUser("user").password("password") auth.inMemoryAuthentication().withUser("user").password("password")
.roles("USER"); .roles("USER");
} }
} }
@Configuration @Configuration
......
...@@ -279,6 +279,7 @@ public class PublicMetricsAutoConfigurationTests { ...@@ -279,6 +279,7 @@ public class PublicMetricsAutoConfigurationTests {
public DataSource commonsDbcpDataSource() { public DataSource commonsDbcpDataSource() {
return InitializedBuilder.create().type(BasicDataSource.class).build(); return InitializedBuilder.create().type(BasicDataSource.class).build();
} }
} }
@Configuration @Configuration
...@@ -295,6 +296,7 @@ public class PublicMetricsAutoConfigurationTests { ...@@ -295,6 +296,7 @@ public class PublicMetricsAutoConfigurationTests {
public DataSource commonsDbcpDataSource() { public DataSource commonsDbcpDataSource() {
return InitializedBuilder.create().type(BasicDataSource.class).build(); return InitializedBuilder.create().type(BasicDataSource.class).build();
} }
} }
@Configuration @Configuration
...@@ -311,6 +313,7 @@ public class PublicMetricsAutoConfigurationTests { ...@@ -311,6 +313,7 @@ public class PublicMetricsAutoConfigurationTests {
public DataSource dataSource() { public DataSource dataSource() {
return InitializedBuilder.create().type(BasicDataSource.class).build(); return InitializedBuilder.create().type(BasicDataSource.class).build();
} }
} }
@Configuration @Configuration
...@@ -326,6 +329,7 @@ public class PublicMetricsAutoConfigurationTests { ...@@ -326,6 +329,7 @@ public class PublicMetricsAutoConfigurationTests {
} }
}; };
} }
} }
@Configuration @Configuration
...@@ -386,4 +390,5 @@ public class PublicMetricsAutoConfigurationTests { ...@@ -386,4 +390,5 @@ public class PublicMetricsAutoConfigurationTests {
} }
} }
} }
...@@ -84,6 +84,7 @@ public class AutoConfigurationReportEndpointTests ...@@ -84,6 +84,7 @@ public class AutoConfigurationReportEndpointTests
public AutoConfigurationReportEndpoint endpoint() { public AutoConfigurationReportEndpoint endpoint() {
return new AutoConfigurationReportEndpoint(); return new AutoConfigurationReportEndpoint();
} }
} }
} }
...@@ -87,10 +87,12 @@ public class ConfigurationPropertiesReportEndpointParentTests { ...@@ -87,10 +87,12 @@ public class ConfigurationPropertiesReportEndpointParentTests {
@Configuration @Configuration
@EnableConfigurationProperties @EnableConfigurationProperties
public static class Parent { public static class Parent {
@Bean @Bean
public TestProperties testProperties() { public TestProperties testProperties() {
return new TestProperties(); return new TestProperties();
} }
} }
@Configuration @Configuration
...@@ -127,6 +129,7 @@ public class ConfigurationPropertiesReportEndpointParentTests { ...@@ -127,6 +129,7 @@ public class ConfigurationPropertiesReportEndpointParentTests {
} }
public static class OtherProperties { public static class OtherProperties {
} }
@ConfigurationProperties(prefix = "test") @ConfigurationProperties(prefix = "test")
...@@ -143,4 +146,5 @@ public class ConfigurationPropertiesReportEndpointParentTests { ...@@ -143,4 +146,5 @@ public class ConfigurationPropertiesReportEndpointParentTests {
} }
} }
} }
...@@ -318,6 +318,7 @@ public class ConfigurationPropertiesReportEndpointSerializationTests { ...@@ -318,6 +318,7 @@ public class ConfigurationPropertiesReportEndpointSerializationTests {
} }
public static class Bar { public static class Bar {
private String name = "123456"; private String name = "123456";
public String getName() { public String getName() {
...@@ -327,6 +328,7 @@ public class ConfigurationPropertiesReportEndpointSerializationTests { ...@@ -327,6 +328,7 @@ public class ConfigurationPropertiesReportEndpointSerializationTests {
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
} }
} }
......
...@@ -186,10 +186,12 @@ public class ConfigurationPropertiesReportEndpointTests ...@@ -186,10 +186,12 @@ public class ConfigurationPropertiesReportEndpointTests
@Configuration @Configuration
@EnableConfigurationProperties @EnableConfigurationProperties
public static class Parent { public static class Parent {
@Bean @Bean
public TestProperties testProperties() { public TestProperties testProperties() {
return new TestProperties(); return new TestProperties();
} }
} }
@Configuration @Configuration
...@@ -281,4 +283,5 @@ public class ConfigurationPropertiesReportEndpointTests ...@@ -281,4 +283,5 @@ public class ConfigurationPropertiesReportEndpointTests
} }
} }
} }
...@@ -54,4 +54,5 @@ public class DumpEndpointTests extends AbstractEndpointTests<DumpEndpoint> { ...@@ -54,4 +54,5 @@ public class DumpEndpointTests extends AbstractEndpointTests<DumpEndpoint> {
} }
} }
} }
...@@ -204,4 +204,5 @@ public class EnvironmentEndpointTests extends AbstractEndpointTests<EnvironmentE ...@@ -204,4 +204,5 @@ public class EnvironmentEndpointTests extends AbstractEndpointTests<EnvironmentE
} }
} }
} }
...@@ -74,5 +74,7 @@ public class HealthEndpointTests extends AbstractEndpointTests<HealthEndpoint> { ...@@ -74,5 +74,7 @@ public class HealthEndpointTests extends AbstractEndpointTests<HealthEndpoint> {
public HealthAggregator healthAggregator() { public HealthAggregator healthAggregator() {
return new OrderedHealthAggregator(); return new OrderedHealthAggregator();
} }
} }
} }
...@@ -111,4 +111,5 @@ public class MetricsEndpointTests extends AbstractEndpointTests<MetricsEndpoint> ...@@ -111,4 +111,5 @@ public class MetricsEndpointTests extends AbstractEndpointTests<MetricsEndpoint>
} }
} }
} }
...@@ -126,6 +126,7 @@ public class RequestMappingEndpointTests { ...@@ -126,6 +126,7 @@ public class RequestMappingEndpointTests {
@Configuration @Configuration
protected static class MappingConfiguration { protected static class MappingConfiguration {
@Bean @Bean
@Lazy @Lazy
@Scope(proxyMode = ScopedProxyMode.TARGET_CLASS) @Scope(proxyMode = ScopedProxyMode.TARGET_CLASS)
...@@ -134,5 +135,7 @@ public class RequestMappingEndpointTests { ...@@ -134,5 +135,7 @@ public class RequestMappingEndpointTests {
mapping.setUrlMap(Collections.singletonMap("/foo", new Object())); mapping.setUrlMap(Collections.singletonMap("/foo", new Object()));
return mapping; return mapping;
} }
} }
} }
...@@ -102,4 +102,5 @@ public class ShutdownEndpointTests extends AbstractEndpointTests<ShutdownEndpoin ...@@ -102,4 +102,5 @@ public class ShutdownEndpointTests extends AbstractEndpointTests<ShutdownEndpoin
} }
} }
} }
...@@ -96,9 +96,12 @@ public class ShutdownParentEndpointTests { ...@@ -96,9 +96,12 @@ public class ShutdownParentEndpointTests {
}; };
} }
} }
@Configuration @Configuration
public static class Empty { public static class Empty {
} }
} }
...@@ -56,5 +56,7 @@ public class TraceEndpointTests extends AbstractEndpointTests<TraceEndpoint> { ...@@ -56,5 +56,7 @@ public class TraceEndpointTests extends AbstractEndpointTests<TraceEndpoint> {
repository.add(Collections.<String, Object>singletonMap("a", "b")); repository.add(Collections.<String, Object>singletonMap("a", "b"));
return new TraceEndpoint(repository); return new TraceEndpoint(repository);
} }
} }
} }
...@@ -269,8 +269,8 @@ public class EndpointMBeanExporterTests { ...@@ -269,8 +269,8 @@ public class EndpointMBeanExporterTests {
MBeanExporter mbeanExporter = registerLoggersEndpoint(); MBeanExporter mbeanExporter = registerLoggersEndpoint();
Object response = mbeanExporter.getServer().invoke( Object response = mbeanExporter.getServer().invoke(
getObjectName("loggersEndpoint", this.context), "setLogLevel", getObjectName("loggersEndpoint", this.context), "setLogLevel",
new Object[]{"com.example", "trace"}, new Object[] { "com.example", "trace" },
new String[]{String.class.getName(), String.class.getName()}); new String[] { String.class.getName(), String.class.getName() });
assertThat(response).isNull(); assertThat(response).isNull();
} }
...@@ -280,10 +280,9 @@ public class EndpointMBeanExporterTests { ...@@ -280,10 +280,9 @@ public class EndpointMBeanExporterTests {
this.thrown.expect(MBeanException.class); this.thrown.expect(MBeanException.class);
this.thrown.expectCause(hasMessage(containsString("No enum constant"))); this.thrown.expectCause(hasMessage(containsString("No enum constant")));
this.thrown.expectCause(hasMessage(containsString("LogLevel.INVALID"))); this.thrown.expectCause(hasMessage(containsString("LogLevel.INVALID")));
mbeanExporter.getServer().invoke( mbeanExporter.getServer().invoke(getObjectName("loggersEndpoint", this.context),
getObjectName("loggersEndpoint", this.context), "setLogLevel", "setLogLevel", new Object[] { "com.example", "invalid" },
new Object[]{"com.example", "invalid"}, new String[] { String.class.getName(), String.class.getName() });
new String[]{String.class.getName(), String.class.getName()});
} }
private MBeanExporter registerLoggersEndpoint() { private MBeanExporter registerLoggersEndpoint() {
......
...@@ -90,14 +90,17 @@ public class JolokiaMvcEndpointContextPathTests { ...@@ -90,14 +90,17 @@ public class JolokiaMvcEndpointContextPathTests {
EndpointWebMvcAutoConfiguration.class, JolokiaAutoConfiguration.class, EndpointWebMvcAutoConfiguration.class, JolokiaAutoConfiguration.class,
ManagementServerPropertiesAutoConfiguration.class }) ManagementServerPropertiesAutoConfiguration.class })
public static class Config { public static class Config {
} }
public static class ContextPathListener public static class ContextPathListener
implements ApplicationContextInitializer<ConfigurableApplicationContext> { implements ApplicationContextInitializer<ConfigurableApplicationContext> {
@Override @Override
public void initialize(ConfigurableApplicationContext context) { public void initialize(ConfigurableApplicationContext context) {
EnvironmentTestUtils.addEnvironment(context, "management.contextPath:/admin"); EnvironmentTestUtils.addEnvironment(context, "management.contextPath:/admin");
} }
} }
} }
...@@ -101,6 +101,7 @@ public class MvcEndpointsTests { ...@@ -101,6 +101,7 @@ public class MvcEndpointsTests {
public String invoke() { public String invoke() {
return "foo"; return "foo";
} }
} }
private static class TestMvcEndpoint extends EndpointMvcAdapter { private static class TestMvcEndpoint extends EndpointMvcAdapter {
...@@ -108,6 +109,7 @@ public class MvcEndpointsTests { ...@@ -108,6 +109,7 @@ public class MvcEndpointsTests {
TestMvcEndpoint(Endpoint<?> delegate) { TestMvcEndpoint(Endpoint<?> delegate) {
super(delegate); super(delegate);
} }
} }
private static class OtherTestMvcEndpoint extends EndpointMvcAdapter { private static class OtherTestMvcEndpoint extends EndpointMvcAdapter {
...@@ -115,6 +117,7 @@ public class MvcEndpointsTests { ...@@ -115,6 +117,7 @@ public class MvcEndpointsTests {
OtherTestMvcEndpoint(Endpoint<?> delegate) { OtherTestMvcEndpoint(Endpoint<?> delegate) {
super(delegate); super(delegate);
} }
} }
} }
...@@ -235,4 +235,5 @@ public class ElasticsearchHealthIndicatorTests { ...@@ -235,4 +235,5 @@ public class ElasticsearchHealthIndicatorTests {
} }
} }
} }
...@@ -33,6 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -33,6 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
public class DropwizardMetricServicesTests { public class DropwizardMetricServicesTests {
private final MetricRegistry registry = new MetricRegistry(); private final MetricRegistry registry = new MetricRegistry();
private final DropwizardMetricServices writer = new DropwizardMetricServices( private final DropwizardMetricServices writer = new DropwizardMetricServices(
this.registry); this.registry);
...@@ -89,7 +90,6 @@ public class DropwizardMetricServicesTests { ...@@ -89,7 +90,6 @@ public class DropwizardMetricServicesTests {
* thread is updating the same set of metrics. This would be an example case of the * thread is updating the same set of metrics. This would be an example case of the
* writer being used with the MetricsFilter handling several requests/sec to the same * writer being used with the MetricsFilter handling several requests/sec to the same
* URL. * URL.
*
* @throws Exception if an error occurs * @throws Exception if an error occurs
*/ */
@Test @Test
......
...@@ -53,10 +53,12 @@ public class SpringIntegrationMetricReaderTests { ...@@ -53,10 +53,12 @@ public class SpringIntegrationMetricReaderTests {
@Configuration @Configuration
@Import({ JmxAutoConfiguration.class, IntegrationAutoConfiguration.class }) @Import({ JmxAutoConfiguration.class, IntegrationAutoConfiguration.class })
protected static class TestConfiguration { protected static class TestConfiguration {
@Bean @Bean
public SpringIntegrationMetricReader reader(IntegrationMBeanExporter exporter) { public SpringIntegrationMetricReader reader(IntegrationMBeanExporter exporter) {
return new SpringIntegrationMetricReader(exporter); return new SpringIntegrationMetricReader(exporter);
} }
} }
} }
...@@ -32,9 +32,12 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -32,9 +32,12 @@ import static org.assertj.core.api.Assertions.assertThat;
public class MultiMetricRichGaugeReaderTests { public class MultiMetricRichGaugeReaderTests {
private InMemoryMetricRepository repository = new InMemoryMetricRepository(); private InMemoryMetricRepository repository = new InMemoryMetricRepository();
private MultiMetricRichGaugeReader reader = new MultiMetricRichGaugeReader( private MultiMetricRichGaugeReader reader = new MultiMetricRichGaugeReader(
this.repository); this.repository);
private InMemoryRichGaugeRepository data = new InMemoryRichGaugeRepository(); private InMemoryRichGaugeRepository data = new InMemoryRichGaugeRepository();
private RichGaugeExporter exporter = new RichGaugeExporter(this.data, private RichGaugeExporter exporter = new RichGaugeExporter(this.data,
this.repository); this.repository);
......
...@@ -86,8 +86,8 @@ public class AuthenticationAuditListenerTests { ...@@ -86,8 +86,8 @@ public class AuthenticationAuditListenerTests {
AuditApplicationEvent event = handleAuthenticationEvent( AuditApplicationEvent event = handleAuthenticationEvent(
new AuthenticationSwitchUserEvent( new AuthenticationSwitchUserEvent(
new UsernamePasswordAuthenticationToken("user", "password"), new UsernamePasswordAuthenticationToken("user", "password"),
new User("user", "password", new User("user", "password", AuthorityUtils
AuthorityUtils.commaSeparatedStringToAuthorityList("USER")))); .commaSeparatedStringToAuthorityList("USER"))));
assertThat(event.getAuditEvent().getType()) assertThat(event.getAuditEvent().getType())
.isEqualTo(AuthenticationAuditListener.AUTHENTICATION_SWITCH); .isEqualTo(AuthenticationAuditListener.AUTHENTICATION_SWITCH);
} }
...@@ -98,12 +98,12 @@ public class AuthenticationAuditListenerTests { ...@@ -98,12 +98,12 @@ public class AuthenticationAuditListenerTests {
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken( UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
"user", "password"); "user", "password");
authentication.setDetails(details); authentication.setDetails(details);
AuditApplicationEvent event = handleAuthenticationEvent(new AuthenticationFailureExpiredEvent( AuditApplicationEvent event = handleAuthenticationEvent(
authentication, new BadCredentialsException("Bad user"))); new AuthenticationFailureExpiredEvent(authentication,
new BadCredentialsException("Bad user")));
assertThat(event.getAuditEvent().getType()) assertThat(event.getAuditEvent().getType())
.isEqualTo(AuthenticationAuditListener.AUTHENTICATION_FAILURE); .isEqualTo(AuthenticationAuditListener.AUTHENTICATION_FAILURE);
assertThat(event.getAuditEvent().getData()) assertThat(event.getAuditEvent().getData()).containsEntry("details", details);
.containsEntry("details", details);
} }
private AuditApplicationEvent handleAuthenticationEvent( private AuditApplicationEvent handleAuthenticationEvent(
......
...@@ -56,7 +56,8 @@ public class AuthorizationAuditListenerTests { ...@@ -56,7 +56,8 @@ public class AuthorizationAuditListenerTests {
public void testAuthenticationCredentialsNotFound() { public void testAuthenticationCredentialsNotFound() {
AuditApplicationEvent event = handleAuthorizationEvent( AuditApplicationEvent event = handleAuthorizationEvent(
new AuthenticationCredentialsNotFoundEvent(this, new AuthenticationCredentialsNotFoundEvent(this,
Collections.<ConfigAttribute>singletonList(new SecurityConfig("USER")), Collections.<ConfigAttribute>singletonList(
new SecurityConfig("USER")),
new AuthenticationCredentialsNotFoundException("Bad user"))); new AuthenticationCredentialsNotFoundException("Bad user")));
assertThat(event.getAuditEvent().getType()) assertThat(event.getAuditEvent().getType())
.isEqualTo(AuthenticationAuditListener.AUTHENTICATION_FAILURE); .isEqualTo(AuthenticationAuditListener.AUTHENTICATION_FAILURE);
...@@ -66,7 +67,8 @@ public class AuthorizationAuditListenerTests { ...@@ -66,7 +67,8 @@ public class AuthorizationAuditListenerTests {
public void testAuthorizationFailure() { public void testAuthorizationFailure() {
AuditApplicationEvent event = handleAuthorizationEvent( AuditApplicationEvent event = handleAuthorizationEvent(
new AuthorizationFailureEvent(this, new AuthorizationFailureEvent(this,
Collections.<ConfigAttribute>singletonList(new SecurityConfig("USER")), Collections.<ConfigAttribute>singletonList(
new SecurityConfig("USER")),
new UsernamePasswordAuthenticationToken("user", "password"), new UsernamePasswordAuthenticationToken("user", "password"),
new AccessDeniedException("Bad user"))); new AccessDeniedException("Bad user")));
assertThat(event.getAuditEvent().getType()) assertThat(event.getAuditEvent().getType())
...@@ -81,7 +83,8 @@ public class AuthorizationAuditListenerTests { ...@@ -81,7 +83,8 @@ public class AuthorizationAuditListenerTests {
authentication.setDetails(details); authentication.setDetails(details);
AuditApplicationEvent event = handleAuthorizationEvent( AuditApplicationEvent event = handleAuthorizationEvent(
new AuthorizationFailureEvent(this, new AuthorizationFailureEvent(this,
Collections.<ConfigAttribute>singletonList(new SecurityConfig("USER")), Collections.<ConfigAttribute>singletonList(
new SecurityConfig("USER")),
authentication, new AccessDeniedException("Bad user"))); authentication, new AccessDeniedException("Bad user")));
assertThat(event.getAuditEvent().getType()) assertThat(event.getAuditEvent().getType())
.isEqualTo(AuthorizationAuditListener.AUTHORIZATION_FAILURE); .isEqualTo(AuthorizationAuditListener.AUTHORIZATION_FAILURE);
......
...@@ -95,4 +95,5 @@ public abstract class AbstractDependsOnBeanFactoryPostProcessor ...@@ -95,4 +95,5 @@ public abstract class AbstractDependsOnBeanFactoryPostProcessor
throw ex; throw ex;
} }
} }
} }
...@@ -127,6 +127,7 @@ class AutoConfigurationSorter { ...@@ -127,6 +127,7 @@ class AutoConfigurationSorter {
} }
return rtn; return rtn;
} }
} }
private static class AutoConfigurationClass { private static class AutoConfigurationClass {
......
...@@ -71,6 +71,7 @@ import org.springframework.retry.support.RetryTemplate; ...@@ -71,6 +71,7 @@ import org.springframework.retry.support.RetryTemplate;
* <li>{@literal spring.rabbitmq.virtualHost} is used to specify the (optional) virtual * <li>{@literal spring.rabbitmq.virtualHost} is used to specify the (optional) virtual
* host to which the client should connect.</li> * host to which the client should connect.</li>
* </ul> * </ul>
*
* @author Greg Turnquist * @author Greg Turnquist
* @author Josh Long * @author Josh Long
* @author Stephane Nicoll * @author Stephane Nicoll
......
...@@ -47,12 +47,14 @@ public class AopAutoConfiguration { ...@@ -47,12 +47,14 @@ public class AopAutoConfiguration {
@EnableAspectJAutoProxy(proxyTargetClass = false) @EnableAspectJAutoProxy(proxyTargetClass = false)
@ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class", havingValue = "false", matchIfMissing = true) @ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class", havingValue = "false", matchIfMissing = true)
public static class JdkDynamicAutoProxyConfiguration { public static class JdkDynamicAutoProxyConfiguration {
} }
@Configuration @Configuration
@EnableAspectJAutoProxy(proxyTargetClass = true) @EnableAspectJAutoProxy(proxyTargetClass = true)
@ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class", havingValue = "true", matchIfMissing = false) @ConditionalOnProperty(prefix = "spring.aop", name = "proxy-target-class", havingValue = "true", matchIfMissing = false)
public static class CglibAutoProxyConfiguration { public static class CglibAutoProxyConfiguration {
} }
} }
...@@ -111,4 +111,5 @@ public class BatchProperties { ...@@ -111,4 +111,5 @@ public class BatchProperties {
} }
} }
} }
...@@ -101,6 +101,7 @@ public class CacheAutoConfiguration { ...@@ -101,6 +101,7 @@ public class CacheAutoConfiguration {
* instantiation. * instantiation.
*/ */
static class CacheManagerValidatorPostProcessor implements BeanFactoryPostProcessor { static class CacheManagerValidatorPostProcessor implements BeanFactoryPostProcessor {
@Override @Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
throws BeansException { throws BeansException {
...@@ -120,6 +121,7 @@ public class CacheAutoConfiguration { ...@@ -120,6 +121,7 @@ public class CacheAutoConfiguration {
result[result.length - 1] = value; result[result.length - 1] = value;
return result; return result;
} }
} }
/** /**
...@@ -141,6 +143,7 @@ public class CacheAutoConfiguration { ...@@ -141,6 +143,7 @@ public class CacheAutoConfiguration {
+ "be auto-configured, check your configuration (caching " + "be auto-configured, check your configuration (caching "
+ "type is '" + this.cacheProperties.getType() + "')"); + "type is '" + this.cacheProperties.getType() + "')");
} }
} }
/** /**
......
...@@ -67,6 +67,7 @@ abstract class HazelcastInstanceConfiguration { ...@@ -67,6 +67,7 @@ abstract class HazelcastInstanceConfiguration {
existingHazelcastInstance); existingHazelcastInstance);
return this.customizers.customize(cacheManager); return this.customizers.customize(cacheManager);
} }
} }
@Configuration @Configuration
......
...@@ -159,10 +159,12 @@ class JCacheCacheConfiguration { ...@@ -159,10 +159,12 @@ class JCacheCacheConfiguration {
@Conditional(JCacheProviderAvailableCondition.class) @Conditional(JCacheProviderAvailableCondition.class)
static class JCacheProvider { static class JCacheProvider {
} }
@ConditionalOnSingleCandidate(CacheManager.class) @ConditionalOnSingleCandidate(CacheManager.class)
static class CustomJCacheCacheManager { static class CustomJCacheCacheManager {
} }
} }
......
...@@ -264,6 +264,7 @@ public final class ConditionEvaluationReport { ...@@ -264,6 +264,7 @@ public final class ConditionEvaluationReport {
public String toString() { public String toString() {
return this.condition.getClass() + " " + this.outcome; return this.condition.getClass() + " " + this.outcome;
} }
} }
private static class AncestorsMatchedCondition implements Condition { private static class AncestorsMatchedCondition implements Condition {
......
...@@ -228,8 +228,8 @@ public final class ConditionMessage { ...@@ -228,8 +228,8 @@ public final class ConditionMessage {
/** /**
* Indicate that one or more results were found. For example * Indicate that one or more results were found. For example
* {@code found("bean", "beans").items("x", "y")} results in the message * {@code found("bean", "beans").items("x", "y")} results in the message "found
* "found beans x, y". * beans x, y".
* @param singular the article found in singular form * @param singular the article found in singular form
* @param plural the article found in plural form * @param plural the article found in plural form
* @return an {@link ItemsBuilder} * @return an {@link ItemsBuilder}
...@@ -240,8 +240,8 @@ public final class ConditionMessage { ...@@ -240,8 +240,8 @@ public final class ConditionMessage {
/** /**
* Indicate that one or more results were not found. For example * Indicate that one or more results were not found. For example
* {@code didNotFind("bean").items("x")} results in the message * {@code didNotFind("bean").items("x")} results in the message "did not find bean
* "did not find bean x". * x".
* @param article the article found * @param article the article found
* @return an {@link ItemsBuilder} * @return an {@link ItemsBuilder}
*/ */
...@@ -251,8 +251,8 @@ public final class ConditionMessage { ...@@ -251,8 +251,8 @@ public final class ConditionMessage {
/** /**
* Indicate that one or more results were found. For example * Indicate that one or more results were found. For example
* {@code didNotFind("bean", "beans").items("x", "y")} results in the message * {@code didNotFind("bean", "beans").items("x", "y")} results in the message "did
* "did not find beans x, y". * not find beans x, y".
* @param singular the article found in singular form * @param singular the article found in singular form
* @param plural the article found in plural form * @param plural the article found in plural form
* @return an {@link ItemsBuilder} * @return an {@link ItemsBuilder}
...@@ -330,8 +330,8 @@ public final class ConditionMessage { ...@@ -330,8 +330,8 @@ public final class ConditionMessage {
/** /**
* Used when no items are available. For example * Used when no items are available. For example
* {@code didNotFind("any beans").atAll()} results in the message * {@code didNotFind("any beans").atAll()} results in the message "did not find
* "did not find any beans". * any beans".
* @return a built {@link ConditionMessage} * @return a built {@link ConditionMessage}
*/ */
public ConditionMessage atAll() { public ConditionMessage atAll() {
...@@ -340,8 +340,8 @@ public final class ConditionMessage { ...@@ -340,8 +340,8 @@ public final class ConditionMessage {
/** /**
* Indicate the items. For example * Indicate the items. For example
* {@code didNotFind("bean", "beans").items("x", "y")} results in the message * {@code didNotFind("bean", "beans").items("x", "y")} results in the message "did
* "did not find beans x, y". * not find beans x, y".
* @param items the items (may be {@code null}) * @param items the items (may be {@code null})
* @return a built {@link ConditionMessage} * @return a built {@link ConditionMessage}
*/ */
...@@ -351,8 +351,8 @@ public final class ConditionMessage { ...@@ -351,8 +351,8 @@ public final class ConditionMessage {
/** /**
* Indicate the items. For example * Indicate the items. For example
* {@code didNotFind("bean", "beans").items("x", "y")} results in the message * {@code didNotFind("bean", "beans").items("x", "y")} results in the message "did
* "did not find beans x, y". * not find beans x, y".
* @param style the render style * @param style the render style
* @param items the items (may be {@code null}) * @param items the items (may be {@code null})
* @return a built {@link ConditionMessage} * @return a built {@link ConditionMessage}
......
...@@ -35,4 +35,5 @@ import org.springframework.context.annotation.Conditional; ...@@ -35,4 +35,5 @@ import org.springframework.context.annotation.Conditional;
@Documented @Documented
@Conditional(OnWebApplicationCondition.class) @Conditional(OnWebApplicationCondition.class)
public @interface ConditionalOnWebApplication { public @interface ConditionalOnWebApplication {
} }
...@@ -439,6 +439,7 @@ class OnBeanCondition extends SpringBootCondition implements ConfigurationCondit ...@@ -439,6 +439,7 @@ class OnBeanCondition extends SpringBootCondition implements ConfigurationCondit
Assert.isTrue(getTypes().size() == 1, annotationName() + " annotations must " Assert.isTrue(getTypes().size() == 1, annotationName() + " annotations must "
+ "specify only one type (got " + getTypes() + ")"); + "specify only one type (got " + getTypes() + ")");
} }
} }
static final class BeanTypeDeductionException extends RuntimeException { static final class BeanTypeDeductionException extends RuntimeException {
......
...@@ -134,10 +134,12 @@ public class CouchbaseAutoConfiguration { ...@@ -134,10 +134,12 @@ public class CouchbaseAutoConfiguration {
@Conditional(OnBootstrapHostsCondition.class) @Conditional(OnBootstrapHostsCondition.class)
static class BootstrapHostsProperty { static class BootstrapHostsProperty {
} }
@ConditionalOnBean(type = "org.springframework.data.couchbase.config.CouchbaseConfigurer") @ConditionalOnBean(type = "org.springframework.data.couchbase.config.CouchbaseConfigurer")
static class CouchbaseConfigurerAvailable { static class CouchbaseConfigurerAvailable {
} }
} }
......
...@@ -51,6 +51,7 @@ class CassandraRepositoriesAutoConfigureRegistrar ...@@ -51,6 +51,7 @@ class CassandraRepositoriesAutoConfigureRegistrar
@EnableCassandraRepositories @EnableCassandraRepositories
private static class EnableCassandraRepositoriesConfiguration { private static class EnableCassandraRepositoriesConfiguration {
} }
} }
...@@ -51,5 +51,7 @@ class JpaRepositoriesAutoConfigureRegistrar ...@@ -51,5 +51,7 @@ class JpaRepositoriesAutoConfigureRegistrar
@EnableJpaRepositories @EnableJpaRepositories
private static class EnableJpaRepositoriesConfiguration { private static class EnableJpaRepositoriesConfiguration {
} }
} }
...@@ -50,6 +50,7 @@ class MongoRepositoriesAutoConfigureRegistrar ...@@ -50,6 +50,7 @@ class MongoRepositoriesAutoConfigureRegistrar
@EnableMongoRepositories @EnableMongoRepositories
private static class EnableMongoRepositoriesConfiguration { private static class EnableMongoRepositoriesConfiguration {
} }
} }
...@@ -256,4 +256,5 @@ public class RedisProperties { ...@@ -256,4 +256,5 @@ public class RedisProperties {
} }
} }
} }
...@@ -133,4 +133,5 @@ public class FlywayProperties { ...@@ -133,4 +133,5 @@ public class FlywayProperties {
public boolean isCreateDataSource() { public boolean isCreateDataSource() {
return this.url != null && this.user != null; return this.url != null && this.user != null;
} }
} }
...@@ -164,4 +164,5 @@ public class FreeMarkerAutoConfiguration { ...@@ -164,4 +164,5 @@ public class FreeMarkerAutoConfiguration {
} }
} }
} }
...@@ -95,4 +95,5 @@ public class H2ConsoleProperties { ...@@ -95,4 +95,5 @@ public class H2ConsoleProperties {
} }
} }
} }
...@@ -126,4 +126,5 @@ public class HypermediaAutoConfiguration { ...@@ -126,4 +126,5 @@ public class HypermediaAutoConfiguration {
} }
} }
} }
...@@ -57,6 +57,7 @@ public class IntegrationAutoConfiguration { ...@@ -57,6 +57,7 @@ public class IntegrationAutoConfiguration {
@Configuration @Configuration
@EnableIntegration @EnableIntegration
protected static class IntegrationConfiguration { protected static class IntegrationConfiguration {
} }
@Configuration @Configuration
......
...@@ -95,6 +95,7 @@ public class DataSourceAutoConfiguration { ...@@ -95,6 +95,7 @@ public class DataSourceAutoConfiguration {
@ConditionalOnMissingBean({ DataSource.class, XADataSource.class }) @ConditionalOnMissingBean({ DataSource.class, XADataSource.class })
@Import(EmbeddedDataSourceConfiguration.class) @Import(EmbeddedDataSourceConfiguration.class)
protected static class EmbeddedDatabaseConfiguration { protected static class EmbeddedDatabaseConfiguration {
} }
@Configuration @Configuration
...@@ -140,10 +141,12 @@ public class DataSourceAutoConfiguration { ...@@ -140,10 +141,12 @@ public class DataSourceAutoConfiguration {
@ConditionalOnProperty(prefix = "spring.datasource", name = "type") @ConditionalOnProperty(prefix = "spring.datasource", name = "type")
static class ExplicitType { static class ExplicitType {
} }
@Conditional(PooledDataSourceAvailableCondition.class) @Conditional(PooledDataSourceAvailableCondition.class)
static class PooledDataSourceAvailable { static class PooledDataSourceAvailable {
} }
} }
...@@ -177,6 +180,7 @@ public class DataSourceAutoConfiguration { ...@@ -177,6 +180,7 @@ public class DataSourceAutoConfiguration {
.findType(); .findType();
return (dataSourceClass == null ? null : dataSourceClass.getClassLoader()); return (dataSourceClass == null ? null : dataSourceClass.getClassLoader());
} }
} }
/** /**
......
...@@ -124,8 +124,8 @@ class DataSourceInitializer implements ApplicationListener<DataSourceInitialized ...@@ -124,8 +124,8 @@ class DataSourceInitializer implements ApplicationListener<DataSourceInitialized
runScripts(scripts, username, password); runScripts(scripts, username, password);
} }
private List<Resource> getScripts(String propertyName, private List<Resource> getScripts(String propertyName, List<String> resources,
List<String> resources, String fallback) { String fallback) {
if (resources != null) { if (resources != null) {
return getResources(propertyName, resources, true); return getResources(propertyName, resources, true);
} }
...@@ -136,8 +136,8 @@ class DataSourceInitializer implements ApplicationListener<DataSourceInitialized ...@@ -136,8 +136,8 @@ class DataSourceInitializer implements ApplicationListener<DataSourceInitialized
return getResources(propertyName, fallbackResources, false); return getResources(propertyName, fallbackResources, false);
} }
private List<Resource> getResources(String propertyName, private List<Resource> getResources(String propertyName, List<String> locations,
List<String> locations, boolean validate) { boolean validate) {
List<Resource> resources = new ArrayList<Resource>(); List<Resource> resources = new ArrayList<Resource>();
for (String location : locations) { for (String location : locations) {
for (Resource resource : doGetResources(location)) { for (Resource resource : doGetResources(location)) {
......
...@@ -117,7 +117,6 @@ public enum EmbeddedDatabaseConnection { ...@@ -117,7 +117,6 @@ public enum EmbeddedDatabaseConnection {
/** /**
* Convenience method to determine if a given driver class name represents an embedded * Convenience method to determine if a given driver class name represents an embedded
* database type. * database type.
*
* @param driverClass the driver class * @param driverClass the driver class
* @return true if the driver class is one of the embedded types * @return true if the driver class is one of the embedded types
*/ */
...@@ -130,7 +129,6 @@ public enum EmbeddedDatabaseConnection { ...@@ -130,7 +129,6 @@ public enum EmbeddedDatabaseConnection {
/** /**
* Convenience method to determine if a given data source represents an embedded * Convenience method to determine if a given data source represents an embedded
* database type. * database type.
*
* @param dataSource the data source to interrogate * @param dataSource the data source to interrogate
* @return true if the data source is one of the embedded types * @return true if the data source is one of the embedded types
*/ */
...@@ -186,4 +184,5 @@ public enum EmbeddedDatabaseConnection { ...@@ -186,4 +184,5 @@ public enum EmbeddedDatabaseConnection {
} }
} }
} }
...@@ -228,6 +228,7 @@ public class JerseyAutoConfiguration implements ServletContextAware { ...@@ -228,6 +228,7 @@ public class JerseyAutoConfiguration implements ServletContextAware {
// will try and register a ContextLoaderListener which we don't need // will try and register a ContextLoaderListener which we don't need
servletContext.setInitParameter("contextConfigLocation", "<NONE>"); servletContext.setInitParameter("contextConfigLocation", "<NONE>");
} }
} }
@ConditionalOnClass(JacksonFeature.class) @ConditionalOnClass(JacksonFeature.class)
......
...@@ -85,7 +85,9 @@ public class JerseyProperties { ...@@ -85,7 +85,9 @@ public class JerseyProperties {
} }
public enum Type { public enum Type {
SERVLET, FILTER SERVLET, FILTER
} }
public static class Filter { public static class Filter {
......
...@@ -85,6 +85,7 @@ class JmsAnnotationDrivenConfiguration { ...@@ -85,6 +85,7 @@ class JmsAnnotationDrivenConfiguration {
@EnableJms @EnableJms
@ConditionalOnMissingBean(name = JmsListenerConfigUtils.JMS_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME) @ConditionalOnMissingBean(name = JmsListenerConfigUtils.JMS_LISTENER_ANNOTATION_PROCESSOR_BEAN_NAME)
protected static class EnableJmsConfiguration { protected static class EnableJmsConfiguration {
} }
@ConditionalOnJndi @ConditionalOnJndi
......
...@@ -101,6 +101,7 @@ public class JmsAutoConfiguration { ...@@ -101,6 +101,7 @@ public class JmsAutoConfiguration {
} }
return jmsTemplate; return jmsTemplate;
} }
} }
@ConditionalOnClass(JmsMessagingTemplate.class) @ConditionalOnClass(JmsMessagingTemplate.class)
......
...@@ -130,6 +130,7 @@ public class JmsProperties { ...@@ -130,6 +130,7 @@ public class JmsProperties {
? this.concurrency + "-" + this.maxConcurrency ? this.concurrency + "-" + this.maxConcurrency
: String.valueOf(this.concurrency)); : String.valueOf(this.concurrency));
} }
} }
public static class Template { public static class Template {
......
...@@ -95,10 +95,12 @@ public class JndiConnectionFactoryAutoConfiguration { ...@@ -95,10 +95,12 @@ public class JndiConnectionFactoryAutoConfiguration {
@ConditionalOnJndi({ "java:/JmsXA", "java:/XAConnectionFactory" }) @ConditionalOnJndi({ "java:/JmsXA", "java:/XAConnectionFactory" })
static class Jndi { static class Jndi {
} }
@ConditionalOnProperty(prefix = "spring.jms", name = "jndi-name") @ConditionalOnProperty(prefix = "spring.jms", name = "jndi-name")
static class Property { static class Property {
} }
} }
......
...@@ -30,8 +30,8 @@ import org.springframework.jdbc.support.SQLExceptionTranslator; ...@@ -30,8 +30,8 @@ import org.springframework.jdbc.support.SQLExceptionTranslator;
import org.springframework.jdbc.support.SQLStateSQLExceptionTranslator; import org.springframework.jdbc.support.SQLStateSQLExceptionTranslator;
/** /**
* Transforms {@link java.sql.SQLException} into a Spring-specific {@link * Transforms {@link java.sql.SQLException} into a Spring-specific
* DataAccessException}. * {@link DataAccessException}.
* *
* @author Lukas Eder * @author Lukas Eder
* @author Andreas Ahlenstorf * @author Andreas Ahlenstorf
...@@ -66,8 +66,8 @@ class JooqExceptionTranslator extends DefaultExecuteListener { ...@@ -66,8 +66,8 @@ class JooqExceptionTranslator extends DefaultExecuteListener {
/** /**
* Handle a single exception in the chain. SQLExceptions might be nested multiple * Handle a single exception in the chain. SQLExceptions might be nested multiple
* levels deep. The outermost exception is usually the least interesting one ( * levels deep. The outermost exception is usually the least interesting one ("Call
* "Call getNextException to see the cause."). Therefore the innermost exception is * getNextException to see the cause."). Therefore the innermost exception is
* propagated and all other exceptions are logged. * propagated and all other exceptions are logged.
* @param context the execute context * @param context the execute context
* @param translator the exception translator * @param translator the exception translator
......
...@@ -122,6 +122,7 @@ public class LiquibaseAutoConfiguration { ...@@ -122,6 +122,7 @@ public class LiquibaseAutoConfiguration {
.username(this.properties.getUser()) .username(this.properties.getUser())
.password(this.properties.getPassword()).build(); .password(this.properties.getPassword()).build();
} }
} }
/** /**
......
...@@ -110,10 +110,12 @@ public class MailSenderAutoConfiguration { ...@@ -110,10 +110,12 @@ public class MailSenderAutoConfiguration {
@ConditionalOnProperty(prefix = "spring.mail", name = "host") @ConditionalOnProperty(prefix = "spring.mail", name = "host")
static class HostProperty { static class HostProperty {
} }
@ConditionalOnProperty(prefix = "spring.mail", name = "jndi-name") @ConditionalOnProperty(prefix = "spring.mail", name = "jndi-name")
static class JndiNameProperty { static class JndiNameProperty {
} }
} }
......
...@@ -194,7 +194,6 @@ public class MongoProperties { ...@@ -194,7 +194,6 @@ public class MongoProperties {
* {@code environment}. If the configured port is zero, the value of the * {@code environment}. If the configured port is zero, the value of the
* {@code local.mongo.port} property retrieved from the {@code environment} is used to * {@code local.mongo.port} property retrieved from the {@code environment} is used to
* configure the client. * configure the client.
*
* @param options the options * @param options the options
* @param environment the environment * @param environment the environment
* @return the Mongo client * @return the Mongo client
......
...@@ -121,4 +121,5 @@ public class MustacheAutoConfiguration { ...@@ -121,4 +121,5 @@ public class MustacheAutoConfiguration {
} }
} }
} }
...@@ -106,6 +106,7 @@ class DataSourceInitializedPublisher implements BeanPostProcessor { ...@@ -106,6 +106,7 @@ class DataSourceInitializedPublisher implements BeanPostProcessor {
registry.registerBeanDefinition(BEAN_NAME, beanDefinition); registry.registerBeanDefinition(BEAN_NAME, beanDefinition);
} }
} }
} }
} }
...@@ -43,4 +43,5 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur ...@@ -43,4 +43,5 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
@AutoConfigureAfter(SecurityAutoConfiguration.class) @AutoConfigureAfter(SecurityAutoConfiguration.class)
@EnableWebSecurity @EnableWebSecurity
public class FallbackWebSecurityAutoConfiguration { public class FallbackWebSecurityAutoConfiguration {
} }
...@@ -171,7 +171,9 @@ public class SecurityProperties implements SecurityPrerequisite { ...@@ -171,7 +171,9 @@ public class SecurityProperties implements SecurityPrerequisite {
public static class Headers { public static class Headers {
public enum HSTS { public enum HSTS {
NONE, DOMAIN, ALL NONE, DOMAIN, ALL
} }
public enum ContentSecurityPolicyMode { public enum ContentSecurityPolicyMode {
......
...@@ -237,6 +237,7 @@ public class SpringBootWebSecurityConfiguration { ...@@ -237,6 +237,7 @@ public class SpringBootWebSecurityConfiguration {
@Order(SecurityProperties.BASIC_AUTH_ORDER) @Order(SecurityProperties.BASIC_AUTH_ORDER)
protected static class ApplicationNoWebSecurityConfigurerAdapter protected static class ApplicationNoWebSecurityConfigurerAdapter
extends WebSecurityConfigurerAdapter { extends WebSecurityConfigurerAdapter {
@Override @Override
protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception {
http.requestMatcher(new RequestMatcher() { http.requestMatcher(new RequestMatcher() {
...@@ -246,6 +247,7 @@ public class SpringBootWebSecurityConfiguration { ...@@ -246,6 +247,7 @@ public class SpringBootWebSecurityConfiguration {
} }
}); });
} }
} }
@Configuration @Configuration
......
...@@ -173,4 +173,5 @@ public class OAuth2RestOperationsConfiguration { ...@@ -173,4 +173,5 @@ public class OAuth2RestOperationsConfiguration {
} }
} }
} }
...@@ -251,6 +251,7 @@ public class ResourceServerProperties implements Validator, BeanFactoryAware { ...@@ -251,6 +251,7 @@ public class ResourceServerProperties implements Validator, BeanFactoryAware {
} }
return null; return null;
} }
} }
} }
...@@ -33,7 +33,6 @@ public interface UserInfoRestTemplateCustomizer { ...@@ -33,7 +33,6 @@ public interface UserInfoRestTemplateCustomizer {
/** /**
* Customize the rest template before it is initialized. * Customize the rest template before it is initialized.
*
* @param template the rest template * @param template the rest template
*/ */
void customize(OAuth2RestTemplate template); void customize(OAuth2RestTemplate template);
......
...@@ -77,11 +77,14 @@ public class SendGridAutoConfiguration { ...@@ -77,11 +77,14 @@ public class SendGridAutoConfiguration {
@ConditionalOnProperty(prefix = "spring.sendgrid", value = "username") @ConditionalOnProperty(prefix = "spring.sendgrid", value = "username")
static class SendGridUserProperty { static class SendGridUserProperty {
} }
@ConditionalOnProperty(prefix = "spring.sendgrid", value = "api-key") @ConditionalOnProperty(prefix = "spring.sendgrid", value = "api-key")
static class SendGridApiKeyProperty { static class SendGridApiKeyProperty {
} }
} }
} }
...@@ -84,6 +84,7 @@ public class LinkedInAutoConfiguration { ...@@ -84,6 +84,7 @@ public class LinkedInAutoConfiguration {
return new LinkedInConnectionFactory(this.properties.getAppId(), return new LinkedInConnectionFactory(this.properties.getAppId(),
this.properties.getAppSecret()); this.properties.getAppSecret());
} }
} }
} }
...@@ -146,6 +146,7 @@ public class SocialWebAutoConfiguration { ...@@ -146,6 +146,7 @@ public class SocialWebAutoConfiguration {
} }
}; };
} }
} }
@Configuration @Configuration
...@@ -186,4 +187,5 @@ public class SocialWebAutoConfiguration { ...@@ -186,4 +187,5 @@ public class SocialWebAutoConfiguration {
} }
} }
} }
...@@ -83,6 +83,7 @@ public class ThymeleafAutoConfiguration { ...@@ -83,6 +83,7 @@ public class ThymeleafAutoConfiguration {
public SpringResourceResourceResolver thymeleafResourceResolver() { public SpringResourceResourceResolver thymeleafResourceResolver() {
return new SpringResourceResourceResolver(); return new SpringResourceResourceResolver();
} }
} }
@Configuration @Configuration
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment