Browse Source

Merge branch '1.5.x' into 2.0.x

pull/16246/head
Andy Wilkinson 7 years ago
parent
commit
361437f4e2
  1. 4
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/CompositeMeterRegistryConfiguration.java
  2. 4
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/scheduling/ScheduledTasksEndpointAutoConfigurationTests.java
  3. 3
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/AbstractEndpointRequestIntegrationTests.java
  4. 5
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfigurationTests.java
  5. 3
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsIntegrationTests.java
  6. 4
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/scheduling/ScheduledTasksEndpointTests.java
  7. 7
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration.java
  8. 3
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryConfiguration.java
  9. 5
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java
  10. 9
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/JndiDataSourceAutoConfigurationTests.java
  11. 4
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfigurationIntegrationTests.java
  12. 4
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java
  13. 3
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketServletAutoConfigurationTests.java
  14. 3
      spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/integrationtest/HttpTunnelIntegrationTests.java
  15. 4
      spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/cloudfoundry/CloudFoundryCustomContextPathExample.java
  16. 4
      spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/security/CustomWebFluxSecurityExample.java
  17. 4
      spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/ImportsContextCustomizerFactoryTests.java
  18. 4
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BeanCurrentlyInCreationFailureAnalyzerTests.java
  19. 4
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/InvalidConfigurationPropertyNameFailureAnalyzerTests.java
  20. 3
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/NoUniqueBeanDefinitionFailureAnalyzerTests.java
  21. 5
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletContextInitializerBeansTests.java
  22. 4
      spring-boot-samples/spring-boot-sample-parent-context/src/main/java/sample/parent/SampleParentContextApplication.java

4
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/CompositeMeterRegistryConfiguration.java

@ -1,5 +1,5 @@ @@ -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.
@ -28,6 +28,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandi @@ -28,6 +28,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandi
import org.springframework.boot.autoconfigure.condition.NoneNestedConditions;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
/**
@ -35,6 +36,7 @@ import org.springframework.context.annotation.Primary; @@ -35,6 +36,7 @@ import org.springframework.context.annotation.Primary;
*
* @author Andy Wilkinson
*/
@Configuration
@Conditional(MultipleNonPrimaryMeterRegistriesCondition.class)
class CompositeMeterRegistryConfiguration {

4
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/scheduling/ScheduledTasksEndpointAutoConfigurationTests.java

@ -1,5 +1,5 @@ @@ -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.
@ -24,6 +24,7 @@ import org.springframework.boot.actuate.scheduling.ScheduledTasksEndpoint; @@ -24,6 +24,7 @@ import org.springframework.boot.actuate.scheduling.ScheduledTasksEndpoint;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import static org.assertj.core.api.Assertions.assertThat;
@ -60,6 +61,7 @@ public class ScheduledTasksEndpointAutoConfigurationTests { @@ -60,6 +61,7 @@ public class ScheduledTasksEndpointAutoConfigurationTests {
.hasBean("customEndpoint"));
}
@Configuration
private static class CustomEndpointConfiguration {
@Bean

3
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/AbstractEndpointRequestIntegrationTests.java

@ -1,5 +1,5 @@ @@ -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.
@ -91,6 +91,7 @@ public abstract class AbstractEndpointRequestIntegrationTests { @@ -91,6 +91,7 @@ public abstract class AbstractEndpointRequestIntegrationTests {
return "Basic " + Base64.getEncoder().encodeToString("user:password".getBytes());
}
@Configuration
static class BaseConfiguration {
@Bean

5
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfigurationTests.java

@ -1,5 +1,5 @@ @@ -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.
@ -22,6 +22,7 @@ import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath; @@ -22,6 +22,7 @@ import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
import org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextListener;
import org.springframework.web.filter.RequestContextFilter;
@ -72,6 +73,7 @@ public class WebMvcEndpointChildContextConfigurationTests { @@ -72,6 +73,7 @@ public class WebMvcEndpointChildContextConfigurationTests {
.isEqualTo("/"));
}
@Configuration
static class ExistingConfig {
@Bean
@ -81,6 +83,7 @@ public class WebMvcEndpointChildContextConfigurationTests { @@ -81,6 +83,7 @@ public class WebMvcEndpointChildContextConfigurationTests {
}
@Configuration
static class RequestContextListenerConfig {
@Bean

3
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsIntegrationTests.java

@ -1,5 +1,5 @@ @@ -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.
@ -114,6 +114,7 @@ public class WebMvcMetricsIntegrationTests { @@ -114,6 +114,7 @@ public class WebMvcMetricsIntegrationTests {
"http.server.requests", true);
}
@Configuration
@RestController
@RequestMapping("/api")
@Timed

4
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/scheduling/ScheduledTasksEndpointTests.java

@ -1,5 +1,5 @@ @@ -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.
@ -28,6 +28,7 @@ import org.springframework.boot.actuate.scheduling.ScheduledTasksEndpoint.FixedR @@ -28,6 +28,7 @@ import org.springframework.boot.actuate.scheduling.ScheduledTasksEndpoint.FixedR
import org.springframework.boot.actuate.scheduling.ScheduledTasksEndpoint.ScheduledTasksReport;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
@ -141,6 +142,7 @@ public class ScheduledTasksEndpointTests { @@ -141,6 +142,7 @@ public class ScheduledTasksEndpointTests {
.accept(context.getBean(ScheduledTasksEndpoint.class).scheduledTasks()));
}
@Configuration
@EnableScheduling
private static class BaseConfiguration {

7
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration.java

@ -1,5 +1,5 @@ @@ -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.
@ -26,6 +26,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; @@ -26,6 +26,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DatabaseDriver;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.StringUtils;
/**
@ -46,6 +47,7 @@ abstract class DataSourceConfiguration { @@ -46,6 +47,7 @@ abstract class DataSourceConfiguration {
/**
* Tomcat Pool DataSource configuration.
*/
@Configuration
@ConditionalOnClass(org.apache.tomcat.jdbc.pool.DataSource.class)
@ConditionalOnMissingBean(DataSource.class)
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "org.apache.tomcat.jdbc.pool.DataSource", matchIfMissing = true)
@ -72,6 +74,7 @@ abstract class DataSourceConfiguration { @@ -72,6 +74,7 @@ abstract class DataSourceConfiguration {
/**
* Hikari DataSource configuration.
*/
@Configuration
@ConditionalOnClass(HikariDataSource.class)
@ConditionalOnMissingBean(DataSource.class)
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "com.zaxxer.hikari.HikariDataSource", matchIfMissing = true)
@ -93,6 +96,7 @@ abstract class DataSourceConfiguration { @@ -93,6 +96,7 @@ abstract class DataSourceConfiguration {
/**
* DBCP DataSource configuration.
*/
@Configuration
@ConditionalOnClass(org.apache.commons.dbcp2.BasicDataSource.class)
@ConditionalOnMissingBean(DataSource.class)
@ConditionalOnProperty(name = "spring.datasource.type", havingValue = "org.apache.commons.dbcp2.BasicDataSource", matchIfMissing = true)
@ -111,6 +115,7 @@ abstract class DataSourceConfiguration { @@ -111,6 +115,7 @@ abstract class DataSourceConfiguration {
/**
* Generic DataSource configuration.
*/
@Configuration
@ConditionalOnMissingBean(DataSource.class)
@ConditionalOnProperty(name = "spring.datasource.type")
static class Generic {

3
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerFactoryConfiguration.java

@ -1,5 +1,5 @@ @@ -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.
@ -75,6 +75,7 @@ abstract class ReactiveWebServerFactoryConfiguration { @@ -75,6 +75,7 @@ abstract class ReactiveWebServerFactoryConfiguration {
}
@Configuration
@ConditionalOnMissingBean(ReactiveWebServerFactory.class)
@ConditionalOnClass({ Undertow.class })
static class EmbeddedUndertow {

5
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java

@ -1,5 +1,5 @@ @@ -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.
@ -311,6 +311,7 @@ public class BatchAutoConfigurationTests { @@ -311,6 +311,7 @@ public class BatchAutoConfigurationTests {
}
@Configuration
@EnableBatchProcessing
protected static class NamedJobConfigurationWithRegisteredJob {
@ -352,6 +353,7 @@ public class BatchAutoConfigurationTests { @@ -352,6 +353,7 @@ public class BatchAutoConfigurationTests {
}
@Configuration
@EnableBatchProcessing
protected static class NamedJobConfigurationWithLocalJob {
@ -383,6 +385,7 @@ public class BatchAutoConfigurationTests { @@ -383,6 +385,7 @@ public class BatchAutoConfigurationTests {
}
@Configuration
@EnableBatchProcessing
protected static class JobConfiguration {

9
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/JndiDataSourceAutoConfigurationTests.java

@ -1,5 +1,5 @@ @@ -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.
@ -33,6 +33,7 @@ import org.springframework.boot.autoconfigure.jndi.TestableInitialContextFactory @@ -33,6 +33,7 @@ import org.springframework.boot.autoconfigure.jndi.TestableInitialContextFactory
import org.springframework.boot.test.util.TestPropertyValues;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jmx.export.MBeanExporter;
import static org.assertj.core.api.Assertions.assertThat;
@ -161,7 +162,8 @@ public class JndiDataSourceAutoConfigurationTests { @@ -161,7 +162,8 @@ public class JndiDataSourceAutoConfigurationTests {
TestableInitialContextFactory.bind(name, dataSource);
}
private static class MBeanExporterConfiguration {
@Configuration
static class MBeanExporterConfiguration {
@Bean
MBeanExporter mbeanExporter() {
@ -170,7 +172,8 @@ public class JndiDataSourceAutoConfigurationTests { @@ -170,7 +172,8 @@ public class JndiDataSourceAutoConfigurationTests {
}
private static class AnotherMBeanExporterConfiguration {
@Configuration
static class AnotherMBeanExporterConfiguration {
@Bean
MBeanExporter anotherMbeanExporter() {

4
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfigurationIntegrationTests.java

@ -1,5 +1,5 @@ @@ -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.
@ -28,6 +28,7 @@ import org.junit.Test; @@ -28,6 +28,7 @@ import org.junit.Test;
import org.springframework.boot.test.util.TestPropertyValues;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.core.DefaultKafkaProducerFactory;
import org.springframework.kafka.core.KafkaTemplate;
@ -97,6 +98,7 @@ public class KafkaAutoConfigurationIntegrationTests { @@ -97,6 +98,7 @@ public class KafkaAutoConfigurationIntegrationTests {
return applicationContext;
}
@Configuration
public static class KafkaConfig {
@Bean

4
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java

@ -1,5 +1,5 @@ @@ -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.
@ -354,6 +354,7 @@ public class MultipartAutoConfigurationTests { @@ -354,6 +354,7 @@ public class MultipartAutoConfigurationTests {
}
@Configuration
public static class WebServerWithCustomMultipartResolver {
@Bean
@ -363,6 +364,7 @@ public class MultipartAutoConfigurationTests { @@ -363,6 +364,7 @@ public class MultipartAutoConfigurationTests {
}
@Configuration
public static class ContainerWithCommonsMultipartResolver {
@Bean

3
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketServletAutoConfigurationTests.java

@ -1,5 +1,5 @@ @@ -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.
@ -75,6 +75,7 @@ public class WebSocketServletAutoConfigurationTests { @@ -75,6 +75,7 @@ public class WebSocketServletAutoConfigurationTests {
}
@Configuration
static class CommonConfiguration {
@Bean

3
spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/integrationtest/HttpTunnelIntegrationTests.java

@ -1,5 +1,5 @@ @@ -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.
@ -128,6 +128,7 @@ public class HttpTunnelIntegrationTests { @@ -128,6 +128,7 @@ public class HttpTunnelIntegrationTests {
}
@Configuration
static class TunnelConfiguration {
@Bean

4
spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/cloudfoundry/CloudFoundryCustomContextPathExample.java

@ -1,5 +1,5 @@ @@ -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.
@ -34,12 +34,14 @@ import org.apache.catalina.startup.Tomcat; @@ -34,12 +34,14 @@ import org.apache.catalina.startup.Tomcat;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* Example configuration for custom context path in Cloud Foundry.
*
* @author Johnny Lim
*/
@Configuration
public class CloudFoundryCustomContextPathExample {
// tag::configuration[]

4
spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/security/CustomWebFluxSecurityExample.java

@ -1,5 +1,5 @@ @@ -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.
@ -18,6 +18,7 @@ package org.springframework.boot.docs.web.security; @@ -18,6 +18,7 @@ package org.springframework.boot.docs.web.security;
import org.springframework.boot.autoconfigure.security.reactive.PathRequest;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.web.server.ServerHttpSecurity;
import org.springframework.security.web.server.SecurityWebFilterChain;
@ -26,6 +27,7 @@ import org.springframework.security.web.server.SecurityWebFilterChain; @@ -26,6 +27,7 @@ import org.springframework.security.web.server.SecurityWebFilterChain;
*
* @author Madhura Bhave
*/
@Configuration
public class CustomWebFluxSecurityExample {
// @formatter:off

4
spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/ImportsContextCustomizerFactoryTests.java

@ -1,5 +1,5 @@ @@ -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.
@ -25,6 +25,7 @@ import org.junit.rules.ExpectedException; @@ -25,6 +25,7 @@ import org.junit.rules.ExpectedException;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.stereotype.Component;
import org.springframework.test.context.ContextCustomizer;
@ -133,6 +134,7 @@ public class ImportsContextCustomizerFactoryTests { @@ -133,6 +134,7 @@ public class ImportsContextCustomizerFactoryTests {
}
@Configuration
@Import(ImportedBean.class)
static class TestWithImportAndBeanMethod {

4
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BeanCurrentlyInCreationFailureAnalyzerTests.java

@ -1,5 +1,5 @@ @@ -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.
@ -226,6 +226,7 @@ public class BeanCurrentlyInCreationFailureAnalyzerTests { @@ -226,6 +226,7 @@ public class BeanCurrentlyInCreationFailureAnalyzerTests {
return new BeanOne();
}
@org.springframework.context.annotation.Configuration
public static class BeanTwoConfiguration {
@SuppressWarnings("unused")
@ -239,6 +240,7 @@ public class BeanCurrentlyInCreationFailureAnalyzerTests { @@ -239,6 +240,7 @@ public class BeanCurrentlyInCreationFailureAnalyzerTests {
}
@org.springframework.context.annotation.Configuration
public static class BeanThreeConfiguration {
@Bean

4
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/InvalidConfigurationPropertyNameFailureAnalyzerTests.java

@ -1,5 +1,5 @@ @@ -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.
@ -24,6 +24,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties @@ -24,6 +24,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.boot.diagnostics.FailureAnalysis;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import static org.assertj.core.api.Assertions.assertThat;
@ -60,6 +61,7 @@ public class InvalidConfigurationPropertyNameFailureAnalyzerTests { @@ -60,6 +61,7 @@ public class InvalidConfigurationPropertyNameFailureAnalyzerTests {
}
}
@Configuration
@EnableConfigurationProperties(InvalidPrefixProperties.class)
static class InvalidPrefixConfiguration {

3
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/NoUniqueBeanDefinitionFailureAnalyzerTests.java

@ -1,5 +1,5 @@ @@ -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.
@ -153,6 +153,7 @@ public class NoUniqueBeanDefinitionFailureAnalyzerTests { @@ -153,6 +153,7 @@ public class NoUniqueBeanDefinitionFailureAnalyzerTests {
}
@Configuration
static class ParentProducer {
@Bean

5
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletContextInitializerBeansTests.java

@ -1,5 +1,5 @@ @@ -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.
@ -29,6 +29,7 @@ import org.junit.Test; @@ -29,6 +29,7 @@ import org.junit.Test;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import static org.assertj.core.api.Assertions.assertThat;
@ -63,6 +64,7 @@ public class ServletContextInitializerBeansTests { @@ -63,6 +64,7 @@ public class ServletContextInitializerBeansTests {
this.context = new AnnotationConfigApplicationContext(configuration);
}
@Configuration
static class ServletConfiguration {
@Bean
@ -72,6 +74,7 @@ public class ServletContextInitializerBeansTests { @@ -72,6 +74,7 @@ public class ServletContextInitializerBeansTests {
}
@Configuration
static class FilterConfiguration {
@Bean

4
spring-boot-samples/spring-boot-sample-parent-context/src/main/java/sample/parent/SampleParentContextApplication.java

@ -1,5 +1,5 @@ @@ -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.
@ -24,6 +24,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -24,6 +24,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.integration.channel.DirectChannel;
import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.IntegrationFlows;
@ -41,6 +42,7 @@ public class SampleParentContextApplication { @@ -41,6 +42,7 @@ public class SampleParentContextApplication {
.child(SampleParentContextApplication.class).run(args);
}
@Configuration
@EnableAutoConfiguration
protected static class Parent {

Loading…
Cancel
Save