SpringBootUtil { public static Properties getPropertiesFromApplicationYamlResource(String springActiveProfile, URL ymlResource) { return YamlUtil.getPropertiesFromYamlResource(springActiveProfile, ymlResource); }  static Properties getSpringBootApplicationProperties(URLClassLoader compileClassLoader); static Properties getSpringBootApplicationProperties(String springActiveProfile, URLClassLoader compileClassLoader); static Properties getPropertiesFromApplicationYamlResource(String springActiveProfile, URL ymlResource); static Optional<String> getSpringBootDevToolsVersion(MavenProject mavenProject); static Optional<String> getSpringBootVersion(MavenProject mavenProject); static String getSpringBootActiveProfile(MavenProject mavenProject);  }
@Test public void testMultipleProfilesParsing() { Properties props = SpringBootUtil.getPropertiesFromApplicationYamlResource(null, getClass().getResource("/util/test-application-with-multiple-profiles.yml")); assertTrue(props.size() > 0); assertEquals("spring-boot-k8-recipes", props.get("spring.application.name")); assertEquals("false", props.get("management.endpoints.enabled-by-default")); assertEquals("true", props.get("management.endpoint.health.enabled")); assertNull(props.get("cloud.kubernetes.reload.enabled")); props = SpringBootUtil.getPropertiesFromApplicationYamlResource("kubernetes", getClass().getResource("/util/test-application-with-multiple-profiles.yml")); assertEquals("true", props.get("cloud.kubernetes.reload.enabled")); assertNull(props.get("spring.application.name")); }