Ensure that @Bean methods are only declared on @Configuration classes

Closes gh-16190
This commit is contained in:
Andy Wilkinson
2019-03-11 15:01:59 +00:00
parent 3fdf2818b3
commit 821ee0cf83
20 changed files with 73 additions and 24 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.
@@ -23,6 +23,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 {
.child(SampleParentContextApplication.class).run(args);
}
@Configuration
@EnableAutoConfiguration
protected static class Parent {