Commit c489c6c5 authored by Andy Wilkinson's avatar Andy Wilkinson

Polish test following forward merge

parent 67dfa0a7
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment