diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata-changelog-generator/src/main/java/org/springframework/boot/configurationmetadata/changelog/Changelog.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata-changelog-generator/src/main/java/org/springframework/boot/configurationmetadata/changelog/Changelog.java index 964298fe567..1a642468559 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata-changelog-generator/src/main/java/org/springframework/boot/configurationmetadata/changelog/Changelog.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata-changelog-generator/src/main/java/org/springframework/boot/configurationmetadata/changelog/Changelog.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import java.util.List; import org.springframework.boot.configurationmetadata.ConfigurationMetadataProperty; import org.springframework.boot.configurationmetadata.ConfigurationMetadataRepository; +import org.springframework.boot.configurationmetadata.Deprecation.Level; /** * A changelog containing differences computed from two repositories of configuration @@ -32,6 +33,7 @@ import org.springframework.boot.configurationmetadata.ConfigurationMetadataRepos * @author Stephane Nicoll * @author Andy Wilkinson * @author Phillip Webb + * @author Yoobin Yoon */ record Changelog(String oldVersionNumber, String newVersionNumber, List differences) { @@ -54,8 +56,13 @@ record Changelog(String oldVersionNumber, String newVersionNumber, List added = differences.differences() .stream() .filter((difference) -> difference.type() == DifferenceType.ADDED) @@ -49,10 +50,12 @@ class ChangelogTests { .stream() .filter((difference) -> difference.type() == DifferenceType.DELETED) .toList(); - assertThat(deleted).hasSize(2) + assertThat(deleted).hasSize(3) .anySatisfy((entry) -> assertProperty(entry.oldProperty(), "test.delete", String.class, "delete")) .anySatisfy( - (entry) -> assertProperty(entry.newProperty(), "test.delete.deprecated", String.class, "delete")); + (entry) -> assertProperty(entry.newProperty(), "test.delete.deprecated", String.class, "delete")) + .anySatisfy((entry) -> assertProperty(entry.newProperty(), "test.removed.directly", String.class, + "directlyRemoved")); List deprecated = differences.differences() .stream() .filter((difference) -> difference.type() == DifferenceType.DEPRECATED) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata-changelog-generator/src/test/resources/sample-1.0.json b/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata-changelog-generator/src/test/resources/sample-1.0.json index a0584bc5695..f17a92a6e96 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata-changelog-generator/src/test/resources/sample-1.0.json +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata-changelog-generator/src/test/resources/sample-1.0.json @@ -26,6 +26,15 @@ "deprecation": { "level": "warning" } + }, + { + "name": "test.delete.error", + "type": "java.lang.String", + "description": "Test delete error.", + "defaultValue": "delete", + "deprecation": { + "level": "error" + } } ] } \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata-changelog-generator/src/test/resources/sample-2.0.json b/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata-changelog-generator/src/test/resources/sample-2.0.json index ef959d39c9e..95a9b8ff501 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata-changelog-generator/src/test/resources/sample-2.0.json +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata-changelog-generator/src/test/resources/sample-2.0.json @@ -31,6 +31,17 @@ "replacement": "test.add", "reason": "it was just bad" } + }, + { + "name": "test.removed.directly", + "type": "java.lang.String", + "description": "Test property removed without prior deprecation.", + "defaultValue": "directlyRemoved", + "deprecation": { + "level": "error", + "replacement": "test.new.property", + "reason": "removed in third-party library without deprecation" + } } ] -} \ No newline at end of file +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata-changelog-generator/src/test/resources/sample.adoc b/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata-changelog-generator/src/test/resources/sample.adoc index 26876aa8542..fd4c354ad89 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata-changelog-generator/src/test/resources/sample.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata-changelog-generator/src/test/resources/sample.adoc @@ -32,4 +32,8 @@ _None_. | `test.delete.deprecated` | `test.add` | it was just bad + +| `test.removed.directly` +| `test.new.property` +| removed in third-party library without deprecation |======================