@ -26,6 +26,7 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
import org.springframework.context.annotation.Bean ;
import org.springframework.context.annotation.Bean ;
import org.springframework.context.annotation.Configuration ;
import org.springframework.context.annotation.Configuration ;
import static org.hamcrest.Matchers.equalTo ;
import static org.hamcrest.Matchers.greaterThan ;
import static org.hamcrest.Matchers.greaterThan ;
import static org.junit.Assert.assertEquals ;
import static org.junit.Assert.assertEquals ;
import static org.junit.Assert.assertNotNull ;
import static org.junit.Assert.assertNotNull ;
@ -151,6 +152,17 @@ public class ConfigurationPropertiesReportEndpointTests extends
assertEquals ( "******" , nestedProperties . get ( "myTestProperty" ) ) ;
assertEquals ( "******" , nestedProperties . get ( "myTestProperty" ) ) ;
}
}
@Test
@SuppressWarnings ( "unchecked" )
public void mixedBoolean ( ) throws Exception {
ConfigurationPropertiesReportEndpoint report = getEndpointBean ( ) ;
Map < String , Object > properties = report . invoke ( ) ;
Map < String , Object > nestedProperties = ( Map < String , Object > ) ( ( Map < String , Object > ) properties
. get ( "testProperties" ) ) . get ( "properties" ) ;
System . out . println ( nestedProperties ) ;
assertThat ( nestedProperties . get ( "mixedBoolean" ) , equalTo ( ( Object ) true ) ) ;
}
@Configuration
@Configuration
@EnableConfigurationProperties
@EnableConfigurationProperties
public static class Parent {
public static class Parent {
@ -183,6 +195,8 @@ public class ConfigurationPropertiesReportEndpointTests extends
private String myTestProperty = "654321" ;
private String myTestProperty = "654321" ;
private Boolean mixedBoolean = true ;
public String getDbPassword ( ) {
public String getDbPassword ( ) {
return this . dbPassword ;
return this . dbPassword ;
}
}
@ -199,5 +213,13 @@ public class ConfigurationPropertiesReportEndpointTests extends
this . myTestProperty = myTestProperty ;
this . myTestProperty = myTestProperty ;
}
}
public boolean isMixedBoolean ( ) {
return ( this . mixedBoolean = = null ? false : this . mixedBoolean ) ;
}
public void setMixedBoolean ( Boolean mixedBoolean ) {
this . mixedBoolean = mixedBoolean ;
}
}
}
}
}