From 8470ecb4d05c2bcaadd9c58cc7564d7687ae02cd Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 15 Sep 2016 09:37:23 +0200 Subject: [PATCH] Polish --- .../config/ConfigFileApplicationListenerTests.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java b/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java index c0f9ce43d05..96b7442c09b 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java @@ -712,11 +712,12 @@ public class ConfigFileApplicationListenerTests { SpringApplication application = new SpringApplication(Config.class); application.setWebEnvironment(false); this.context = application.run("--spring.profiles.active=includeprofile"); - assertThat(this.context.getEnvironment()).has(matchingProfile("includeprofile")); - assertThat(this.context.getEnvironment()).has(matchingProfile("specific")); - assertThat(this.context.getEnvironment()).has(matchingProfile("morespecific")); - assertThat(this.context.getEnvironment()).has(matchingProfile("yetmorespecific")); - assertThat(this.context.getEnvironment()).doesNotHave(matchingProfile("missing")); + ConfigurableEnvironment environment = this.context.getEnvironment(); + assertThat(environment).has(matchingProfile("includeprofile")); + assertThat(environment).has(matchingProfile("specific")); + assertThat(environment).has(matchingProfile("morespecific")); + assertThat(environment).has(matchingProfile("yetmorespecific")); + assertThat(environment).doesNotHave(matchingProfile("missing")); } @Test @@ -825,7 +826,7 @@ public class ConfigFileApplicationListenerTests { assertThat(environment.containsProperty("customprofile")).isTrue(); assertThat(environment.containsProperty("customprofile-specific")).isTrue(); assertThat(environment.containsProperty("customprofile-customdefault")).isTrue(); - assertThat(this.context.getEnvironment().acceptsProfiles("customdefault")) + assertThat(environment.acceptsProfiles("customdefault")) .isTrue(); }