Merge branch '2.0.x'

pull/13757/head
Andy Wilkinson 6 years ago
commit 889f1bce3f

@ -139,12 +139,14 @@ public class ConditionalOnBeanTests {
@Test
public void conditionEvaluationConsidersChangeInTypeWhenBeanIsOverridden() {
this.context.register(OriginalDefinition.class, OverridingDefinition.class,
ConsumingConfiguration.class);
this.context.refresh();
assertThat(this.context.containsBean("testBean")).isTrue();
assertThat(this.context.getBean(Integer.class)).isEqualTo(1);
assertThat(this.context.getBeansOfType(ConsumingConfiguration.class)).isEmpty();
this.contextRunner
.withUserConfiguration(OriginalDefinition.class,
OverridingDefinition.class, ConsumingConfiguration.class)
.run((context) -> {
assertThat(context).hasBean("testBean");
assertThat(context).hasSingleBean(Integer.class);
assertThat(context).doesNotHaveBean(ConsumingConfiguration.class);
});
}
@Configuration

Loading…
Cancel
Save