Skip to content

Commit 3fddfee

Browse files
committed
Fix default value of endpoint's cache ttl
Closes spring-projectsgh-12173
1 parent 56c8bf7 commit 3fddfee

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ private void processEndpoint(AnnotationMirror annotation, TypeElement element) {
438438
if (hasMainReadOperation(element)) {
439439
this.metadataCollector.add(ItemMetadata.newProperty(endpointKey,
440440
"cache.time-to-live", Duration.class.getName(), type, null,
441-
"Maximum time that a response can be cached.", 0, null));
441+
"Maximum time that a response can be cached.", "0ms", null));
442442
}
443443
}
444444

spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ private Metadata.MetadataItemCondition enabledFlag(String endpointId,
706706
private Metadata.MetadataItemCondition cacheTtl(String endpointId) {
707707
return Metadata
708708
.withProperty("management.endpoint." + endpointId + ".cache.time-to-live")
709-
.ofType(Duration.class).withDefaultValue(0)
709+
.ofType(Duration.class).withDefaultValue("0ms")
710710
.withDescription("Maximum time that a response can be cached.");
711711
}
712712

0 commit comments

Comments
 (0)