Use static factory methods and proxyBeanMethods = false
It is better to be explicit about beans of type `Module` and make sure they don't interfere with Spring trying to enhance `@Configuration` classes. The tests are now clear of the pesky warning logs, and there is a new section in the README.
This commit is contained in:
@@ -65,7 +65,7 @@ public class DevelepmentStageInjectorTest {
|
||||
static class ModulesConfig {
|
||||
|
||||
@Bean
|
||||
TestGuiceModule testGuiceModule() {
|
||||
static TestGuiceModule testGuiceModule() {
|
||||
return new TestGuiceModule();
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ public class SpringModuleWrappedTests {
|
||||
protected static class ModuleProviderConfig {
|
||||
|
||||
@Bean
|
||||
public ProviderModule module() {
|
||||
public static ProviderModule module() {
|
||||
return new ProviderModule();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user