Skip to content

Commit

Permalink
Polish test following forward merge
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkinsona committed Jul 11, 2018
1 parent 67dfa0a commit c489c6c
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,14 @@ private void hasBarBean(AssertableApplicationContext context) {

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

0 comments on commit c489c6c

Please sign in to comment.