|
|
|
@ -16,6 +16,7 @@
|
|
|
|
|
|
|
|
|
|
package org.springframework.boot.actuate.context.properties;
|
|
|
|
|
|
|
|
|
|
import java.time.Duration;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Collections;
|
|
|
|
@ -157,6 +158,16 @@ public class ConfigurationPropertiesReportEndpointTests {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void duration() {
|
|
|
|
|
load((context, properties) -> {
|
|
|
|
|
Map<String, Object> nestedProperties = properties.getBeans()
|
|
|
|
|
.get("testProperties").getProperties();
|
|
|
|
|
assertThat(nestedProperties.get("duration"))
|
|
|
|
|
.isEqualTo(Duration.ofSeconds(10).toString());
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void singleLetterProperty() {
|
|
|
|
|
load((context, properties) -> {
|
|
|
|
@ -276,6 +287,8 @@ public class ConfigurationPropertiesReportEndpointTests {
|
|
|
|
|
|
|
|
|
|
private String nullValue = null;
|
|
|
|
|
|
|
|
|
|
private Duration duration = Duration.ofSeconds(10);
|
|
|
|
|
|
|
|
|
|
public TestProperties() {
|
|
|
|
|
this.secrets.put("mine", "myPrivateThing");
|
|
|
|
|
this.secrets.put("yours", "yourPrivateThing");
|
|
|
|
@ -379,6 +392,14 @@ public class ConfigurationPropertiesReportEndpointTests {
|
|
|
|
|
this.nullValue = nullValue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Duration getDuration() {
|
|
|
|
|
return this.duration;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setDuration(Duration duration) {
|
|
|
|
|
this.duration = duration;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class Hidden {
|
|
|
|
|
|
|
|
|
|
private String mine = "mySecret";
|
|
|
|
|