Polish test following forward merge

pull/13815/head
Andy Wilkinson 6 years ago
parent 67dfa0a720
commit c489c6c5f6

@ -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