|
|
@ -155,7 +155,7 @@ class ConditionalOnMissingBeanTests {
|
|
|
|
this.contextRunner
|
|
|
|
this.contextRunner
|
|
|
|
.withUserConfiguration(FactoryBeanConfiguration.class, ConditionalOnFactoryBean.class,
|
|
|
|
.withUserConfiguration(FactoryBeanConfiguration.class, ConditionalOnFactoryBean.class,
|
|
|
|
PropertyPlaceholderAutoConfiguration.class)
|
|
|
|
PropertyPlaceholderAutoConfiguration.class)
|
|
|
|
.run((context) -> assertThat(context.getBean(ExampleBean.class).toString()).isEqualTo("fromFactory"));
|
|
|
|
.run((context) -> assertThat(context.getBean(ExampleBean.class)).hasToString("fromFactory"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
@ -163,7 +163,7 @@ class ConditionalOnMissingBeanTests {
|
|
|
|
this.contextRunner
|
|
|
|
this.contextRunner
|
|
|
|
.withUserConfiguration(ComponentScannedFactoryBeanBeanMethodConfiguration.class,
|
|
|
|
.withUserConfiguration(ComponentScannedFactoryBeanBeanMethodConfiguration.class,
|
|
|
|
ConditionalOnFactoryBean.class, PropertyPlaceholderAutoConfiguration.class)
|
|
|
|
ConditionalOnFactoryBean.class, PropertyPlaceholderAutoConfiguration.class)
|
|
|
|
.run((context) -> assertThat(context.getBean(ScanBean.class).toString()).isEqualTo("fromFactory"));
|
|
|
|
.run((context) -> assertThat(context.getBean(ScanBean.class)).hasToString("fromFactory"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
@ -171,7 +171,7 @@ class ConditionalOnMissingBeanTests {
|
|
|
|
this.contextRunner
|
|
|
|
this.contextRunner
|
|
|
|
.withUserConfiguration(ComponentScannedFactoryBeanBeanMethodWithArgumentsConfiguration.class,
|
|
|
|
.withUserConfiguration(ComponentScannedFactoryBeanBeanMethodWithArgumentsConfiguration.class,
|
|
|
|
ConditionalOnFactoryBean.class, PropertyPlaceholderAutoConfiguration.class)
|
|
|
|
ConditionalOnFactoryBean.class, PropertyPlaceholderAutoConfiguration.class)
|
|
|
|
.run((context) -> assertThat(context.getBean(ScanBean.class).toString()).isEqualTo("fromFactory"));
|
|
|
|
.run((context) -> assertThat(context.getBean(ScanBean.class)).hasToString("fromFactory"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
@ -180,7 +180,7 @@ class ConditionalOnMissingBeanTests {
|
|
|
|
.withUserConfiguration(FactoryBeanWithBeanMethodArgumentsConfiguration.class,
|
|
|
|
.withUserConfiguration(FactoryBeanWithBeanMethodArgumentsConfiguration.class,
|
|
|
|
ConditionalOnFactoryBean.class, PropertyPlaceholderAutoConfiguration.class)
|
|
|
|
ConditionalOnFactoryBean.class, PropertyPlaceholderAutoConfiguration.class)
|
|
|
|
.withPropertyValues("theValue=foo")
|
|
|
|
.withPropertyValues("theValue=foo")
|
|
|
|
.run((context) -> assertThat(context.getBean(ExampleBean.class).toString()).isEqualTo("fromFactory"));
|
|
|
|
.run((context) -> assertThat(context.getBean(ExampleBean.class)).hasToString("fromFactory"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
@ -188,7 +188,7 @@ class ConditionalOnMissingBeanTests {
|
|
|
|
this.contextRunner
|
|
|
|
this.contextRunner
|
|
|
|
.withUserConfiguration(ConcreteFactoryBeanConfiguration.class, ConditionalOnFactoryBean.class,
|
|
|
|
.withUserConfiguration(ConcreteFactoryBeanConfiguration.class, ConditionalOnFactoryBean.class,
|
|
|
|
PropertyPlaceholderAutoConfiguration.class)
|
|
|
|
PropertyPlaceholderAutoConfiguration.class)
|
|
|
|
.run((context) -> assertThat(context.getBean(ExampleBean.class).toString()).isEqualTo("fromFactory"));
|
|
|
|
.run((context) -> assertThat(context.getBean(ExampleBean.class)).hasToString("fromFactory"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
@ -205,7 +205,7 @@ class ConditionalOnMissingBeanTests {
|
|
|
|
this.contextRunner
|
|
|
|
this.contextRunner
|
|
|
|
.withUserConfiguration(RegisteredFactoryBeanConfiguration.class, ConditionalOnFactoryBean.class,
|
|
|
|
.withUserConfiguration(RegisteredFactoryBeanConfiguration.class, ConditionalOnFactoryBean.class,
|
|
|
|
PropertyPlaceholderAutoConfiguration.class)
|
|
|
|
PropertyPlaceholderAutoConfiguration.class)
|
|
|
|
.run((context) -> assertThat(context.getBean(ExampleBean.class).toString()).isEqualTo("fromFactory"));
|
|
|
|
.run((context) -> assertThat(context.getBean(ExampleBean.class)).hasToString("fromFactory"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
@ -213,7 +213,7 @@ class ConditionalOnMissingBeanTests {
|
|
|
|
this.contextRunner
|
|
|
|
this.contextRunner
|
|
|
|
.withUserConfiguration(NonspecificFactoryBeanClassAttributeConfiguration.class,
|
|
|
|
.withUserConfiguration(NonspecificFactoryBeanClassAttributeConfiguration.class,
|
|
|
|
ConditionalOnFactoryBean.class, PropertyPlaceholderAutoConfiguration.class)
|
|
|
|
ConditionalOnFactoryBean.class, PropertyPlaceholderAutoConfiguration.class)
|
|
|
|
.run((context) -> assertThat(context.getBean(ExampleBean.class).toString()).isEqualTo("fromFactory"));
|
|
|
|
.run((context) -> assertThat(context.getBean(ExampleBean.class)).hasToString("fromFactory"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
@ -221,7 +221,7 @@ class ConditionalOnMissingBeanTests {
|
|
|
|
this.contextRunner
|
|
|
|
this.contextRunner
|
|
|
|
.withUserConfiguration(NonspecificFactoryBeanStringAttributeConfiguration.class,
|
|
|
|
.withUserConfiguration(NonspecificFactoryBeanStringAttributeConfiguration.class,
|
|
|
|
ConditionalOnFactoryBean.class, PropertyPlaceholderAutoConfiguration.class)
|
|
|
|
ConditionalOnFactoryBean.class, PropertyPlaceholderAutoConfiguration.class)
|
|
|
|
.run((context) -> assertThat(context.getBean(ExampleBean.class).toString()).isEqualTo("fromFactory"));
|
|
|
|
.run((context) -> assertThat(context.getBean(ExampleBean.class)).hasToString("fromFactory"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
@ -229,7 +229,7 @@ class ConditionalOnMissingBeanTests {
|
|
|
|
this.contextRunner
|
|
|
|
this.contextRunner
|
|
|
|
.withUserConfiguration(FactoryBeanXmlConfiguration.class, ConditionalOnFactoryBean.class,
|
|
|
|
.withUserConfiguration(FactoryBeanXmlConfiguration.class, ConditionalOnFactoryBean.class,
|
|
|
|
PropertyPlaceholderAutoConfiguration.class)
|
|
|
|
PropertyPlaceholderAutoConfiguration.class)
|
|
|
|
.run((context) -> assertThat(context.getBean(ExampleBean.class).toString()).isEqualTo("fromFactory"));
|
|
|
|
.run((context) -> assertThat(context.getBean(ExampleBean.class)).hasToString("fromFactory"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|