Skip to content

Commit

Permalink
BAEL-2878 Guide to Spring's ApplicationContextRunner
Browse files Browse the repository at this point in the history
  • Loading branch information
letcodespeak committed May 26, 2019
1 parent e16ed51 commit 066cf2d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class ConditionalOnBeanIntegrationTest {

@Test
public void whenDependentBeanIsPresent_thenConditionalBeanCreated() {
this.contextRunner.withUserConfiguration(basicConfiguration.class, ConditionalOnBeanConfiguration.class)
this.contextRunner.withUserConfiguration(BasicConfiguration.class, ConditionalOnBeanConfiguration.class)
.run((context) -> {
assertThat(context).hasBean("created");
assertThat(context).getBean("created")
Expand All @@ -28,7 +28,7 @@ public void whenDependentBeanIsPresent_thenConditionalBeanCreated() {

@Test
public void whenDependentBeanIsPresent_thenConditionalMissingBeanIgnored() {
this.contextRunner.withUserConfiguration(basicConfiguration.class, ConditionalOnMissingBeanConfiguration.class)
this.contextRunner.withUserConfiguration(BasicConfiguration.class, ConditionalOnMissingBeanConfiguration.class)
.run((context) -> {
assertThat(context).hasBean("created");
assertThat(context).getBean("created")
Expand All @@ -49,7 +49,7 @@ public void whenDependentBeanIsNotPresent_thenConditionalMissingBeanCreated() {
}

@Configuration
protected static class basicConfiguration {
protected static class BasicConfiguration {
@Bean
public String created() {
return "This is always created";
Expand Down

0 comments on commit 066cf2d

Please sign in to comment.