|
|
@ -155,8 +155,8 @@ public class ConditionalOnBeanTests {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void parameterizedContainerWhenValueIsOfMissingBeanDoesNotMatch() {
|
|
|
|
public void parameterizedContainerWhenValueIsOfMissingBeanDoesNotMatch() {
|
|
|
|
this.contextRunner
|
|
|
|
this.contextRunner
|
|
|
|
.withUserConfiguration(ParmeterizedWithoutCustomConfig.class,
|
|
|
|
.withUserConfiguration(ParameterizedWithoutCustomConfig.class,
|
|
|
|
ParmeterizedConditionWithValueConfig.class)
|
|
|
|
ParameterizedConditionWithValueConfig.class)
|
|
|
|
.run((context) -> assertThat(context)
|
|
|
|
.run((context) -> assertThat(context)
|
|
|
|
.satisfies(exampleBeanRequirement("otherExampleBean")));
|
|
|
|
.satisfies(exampleBeanRequirement("otherExampleBean")));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -164,8 +164,8 @@ public class ConditionalOnBeanTests {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void parameterizedContainerWhenValueIsOfExistingBeanMatches() {
|
|
|
|
public void parameterizedContainerWhenValueIsOfExistingBeanMatches() {
|
|
|
|
this.contextRunner
|
|
|
|
this.contextRunner
|
|
|
|
.withUserConfiguration(ParmeterizedWithCustomConfig.class,
|
|
|
|
.withUserConfiguration(ParameterizedWithCustomConfig.class,
|
|
|
|
ParmeterizedConditionWithValueConfig.class)
|
|
|
|
ParameterizedConditionWithValueConfig.class)
|
|
|
|
.run((context) -> assertThat(context).satisfies(exampleBeanRequirement(
|
|
|
|
.run((context) -> assertThat(context).satisfies(exampleBeanRequirement(
|
|
|
|
"customExampleBean", "conditionalCustomExampleBean")));
|
|
|
|
"customExampleBean", "conditionalCustomExampleBean")));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -173,8 +173,8 @@ public class ConditionalOnBeanTests {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void parameterizedContainerWhenValueIsOfMissingBeanRegistrationDoesNotMatch() {
|
|
|
|
public void parameterizedContainerWhenValueIsOfMissingBeanRegistrationDoesNotMatch() {
|
|
|
|
this.contextRunner
|
|
|
|
this.contextRunner
|
|
|
|
.withUserConfiguration(ParmeterizedWithoutCustomContainerConfig.class,
|
|
|
|
.withUserConfiguration(ParameterizedWithoutCustomContainerConfig.class,
|
|
|
|
ParmeterizedConditionWithValueConfig.class)
|
|
|
|
ParameterizedConditionWithValueConfig.class)
|
|
|
|
.run((context) -> assertThat(context)
|
|
|
|
.run((context) -> assertThat(context)
|
|
|
|
.satisfies(exampleBeanRequirement("otherExampleBean")));
|
|
|
|
.satisfies(exampleBeanRequirement("otherExampleBean")));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -182,8 +182,8 @@ public class ConditionalOnBeanTests {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void parameterizedContainerWhenValueIsOfExistingBeanRegistrationMatches() {
|
|
|
|
public void parameterizedContainerWhenValueIsOfExistingBeanRegistrationMatches() {
|
|
|
|
this.contextRunner
|
|
|
|
this.contextRunner
|
|
|
|
.withUserConfiguration(ParmeterizedWithCustomContainerConfig.class,
|
|
|
|
.withUserConfiguration(ParameterizedWithCustomContainerConfig.class,
|
|
|
|
ParmeterizedConditionWithValueConfig.class)
|
|
|
|
ParameterizedConditionWithValueConfig.class)
|
|
|
|
.run((context) -> assertThat(context).satisfies(exampleBeanRequirement(
|
|
|
|
.run((context) -> assertThat(context).satisfies(exampleBeanRequirement(
|
|
|
|
"customExampleBean", "conditionalCustomExampleBean")));
|
|
|
|
"customExampleBean", "conditionalCustomExampleBean")));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -191,8 +191,8 @@ public class ConditionalOnBeanTests {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void parameterizedContainerWhenReturnTypeIsOfExistingBeanMatches() {
|
|
|
|
public void parameterizedContainerWhenReturnTypeIsOfExistingBeanMatches() {
|
|
|
|
this.contextRunner
|
|
|
|
this.contextRunner
|
|
|
|
.withUserConfiguration(ParmeterizedWithCustomConfig.class,
|
|
|
|
.withUserConfiguration(ParameterizedWithCustomConfig.class,
|
|
|
|
ParmeterizedConditionWithReturnTypeConfig.class)
|
|
|
|
ParameterizedConditionWithReturnTypeConfig.class)
|
|
|
|
.run((context) -> assertThat(context).satisfies(exampleBeanRequirement(
|
|
|
|
.run((context) -> assertThat(context).satisfies(exampleBeanRequirement(
|
|
|
|
"customExampleBean", "conditionalCustomExampleBean")));
|
|
|
|
"customExampleBean", "conditionalCustomExampleBean")));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -200,8 +200,8 @@ public class ConditionalOnBeanTests {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void parameterizedContainerWhenReturnTypeIsOfExistingBeanRegistrationMatches() {
|
|
|
|
public void parameterizedContainerWhenReturnTypeIsOfExistingBeanRegistrationMatches() {
|
|
|
|
this.contextRunner
|
|
|
|
this.contextRunner
|
|
|
|
.withUserConfiguration(ParmeterizedWithCustomContainerConfig.class,
|
|
|
|
.withUserConfiguration(ParameterizedWithCustomContainerConfig.class,
|
|
|
|
ParmeterizedConditionWithReturnTypeConfig.class)
|
|
|
|
ParameterizedConditionWithReturnTypeConfig.class)
|
|
|
|
.run((context) -> assertThat(context).satisfies(exampleBeanRequirement(
|
|
|
|
.run((context) -> assertThat(context).satisfies(exampleBeanRequirement(
|
|
|
|
"customExampleBean", "conditionalCustomExampleBean")));
|
|
|
|
"customExampleBean", "conditionalCustomExampleBean")));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -209,8 +209,8 @@ public class ConditionalOnBeanTests {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void parameterizedContainerWhenReturnRegistrationTypeIsOfExistingBeanMatches() {
|
|
|
|
public void parameterizedContainerWhenReturnRegistrationTypeIsOfExistingBeanMatches() {
|
|
|
|
this.contextRunner
|
|
|
|
this.contextRunner
|
|
|
|
.withUserConfiguration(ParmeterizedWithCustomConfig.class,
|
|
|
|
.withUserConfiguration(ParameterizedWithCustomConfig.class,
|
|
|
|
ParmeterizedConditionWithReturnRegistrationTypeConfig.class)
|
|
|
|
ParameterizedConditionWithReturnRegistrationTypeConfig.class)
|
|
|
|
.run((context) -> assertThat(context).satisfies(exampleBeanRequirement(
|
|
|
|
.run((context) -> assertThat(context).satisfies(exampleBeanRequirement(
|
|
|
|
"customExampleBean", "conditionalCustomExampleBean")));
|
|
|
|
"customExampleBean", "conditionalCustomExampleBean")));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -218,8 +218,8 @@ public class ConditionalOnBeanTests {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void parameterizedContainerWhenReturnRegistrationTypeIsOfExistingBeanRegistrationMatches() {
|
|
|
|
public void parameterizedContainerWhenReturnRegistrationTypeIsOfExistingBeanRegistrationMatches() {
|
|
|
|
this.contextRunner
|
|
|
|
this.contextRunner
|
|
|
|
.withUserConfiguration(ParmeterizedWithCustomContainerConfig.class,
|
|
|
|
.withUserConfiguration(ParameterizedWithCustomContainerConfig.class,
|
|
|
|
ParmeterizedConditionWithReturnRegistrationTypeConfig.class)
|
|
|
|
ParameterizedConditionWithReturnRegistrationTypeConfig.class)
|
|
|
|
.run((context) -> assertThat(context).satisfies(exampleBeanRequirement(
|
|
|
|
.run((context) -> assertThat(context).satisfies(exampleBeanRequirement(
|
|
|
|
"customExampleBean", "conditionalCustomExampleBean")));
|
|
|
|
"customExampleBean", "conditionalCustomExampleBean")));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -415,7 +415,7 @@ public class ConditionalOnBeanTests {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Configuration
|
|
|
|
@Configuration
|
|
|
|
static class ParmeterizedWithCustomConfig {
|
|
|
|
static class ParameterizedWithCustomConfig {
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
@Bean
|
|
|
|
public CustomExampleBean customExampleBean() {
|
|
|
|
public CustomExampleBean customExampleBean() {
|
|
|
@ -425,7 +425,7 @@ public class ConditionalOnBeanTests {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Configuration
|
|
|
|
@Configuration
|
|
|
|
static class ParmeterizedWithoutCustomConfig {
|
|
|
|
static class ParameterizedWithoutCustomConfig {
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
@Bean
|
|
|
|
public OtherExampleBean otherExampleBean() {
|
|
|
|
public OtherExampleBean otherExampleBean() {
|
|
|
@ -435,7 +435,7 @@ public class ConditionalOnBeanTests {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Configuration
|
|
|
|
@Configuration
|
|
|
|
static class ParmeterizedWithoutCustomContainerConfig {
|
|
|
|
static class ParameterizedWithoutCustomContainerConfig {
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
@Bean
|
|
|
|
public TestParameterizedContainer<OtherExampleBean> otherExampleBean() {
|
|
|
|
public TestParameterizedContainer<OtherExampleBean> otherExampleBean() {
|
|
|
@ -445,7 +445,7 @@ public class ConditionalOnBeanTests {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Configuration
|
|
|
|
@Configuration
|
|
|
|
static class ParmeterizedWithCustomContainerConfig {
|
|
|
|
static class ParameterizedWithCustomContainerConfig {
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
@Bean
|
|
|
|
public TestParameterizedContainer<CustomExampleBean> customExampleBean() {
|
|
|
|
public TestParameterizedContainer<CustomExampleBean> customExampleBean() {
|
|
|
@ -455,7 +455,7 @@ public class ConditionalOnBeanTests {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Configuration
|
|
|
|
@Configuration
|
|
|
|
static class ParmeterizedConditionWithValueConfig {
|
|
|
|
static class ParameterizedConditionWithValueConfig {
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
@Bean
|
|
|
|
@ConditionalOnBean(value = CustomExampleBean.class, parameterizedContainer = TestParameterizedContainer.class)
|
|
|
|
@ConditionalOnBean(value = CustomExampleBean.class, parameterizedContainer = TestParameterizedContainer.class)
|
|
|
@ -466,7 +466,7 @@ public class ConditionalOnBeanTests {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Configuration
|
|
|
|
@Configuration
|
|
|
|
static class ParmeterizedConditionWithReturnTypeConfig {
|
|
|
|
static class ParameterizedConditionWithReturnTypeConfig {
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
@Bean
|
|
|
|
@ConditionalOnBean(parameterizedContainer = TestParameterizedContainer.class)
|
|
|
|
@ConditionalOnBean(parameterizedContainer = TestParameterizedContainer.class)
|
|
|
@ -477,7 +477,7 @@ public class ConditionalOnBeanTests {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Configuration
|
|
|
|
@Configuration
|
|
|
|
static class ParmeterizedConditionWithReturnRegistrationTypeConfig {
|
|
|
|
static class ParameterizedConditionWithReturnRegistrationTypeConfig {
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
@Bean
|
|
|
|
@ConditionalOnBean(parameterizedContainer = TestParameterizedContainer.class)
|
|
|
|
@ConditionalOnBean(parameterizedContainer = TestParameterizedContainer.class)
|
|
|
|