|
|
|
|
@ -39,7 +39,7 @@ class ChangelogTests {
@@ -39,7 +39,7 @@ class ChangelogTests {
|
|
|
|
|
assertThat(differences).isNotNull(); |
|
|
|
|
assertThat(differences.oldVersionNumber()).isEqualTo("1.0"); |
|
|
|
|
assertThat(differences.newVersionNumber()).isEqualTo("2.0"); |
|
|
|
|
assertThat(differences.differences()).hasSize(7); |
|
|
|
|
assertThat(differences.differences()).hasSize(9); |
|
|
|
|
List<Difference> added = differences.differences() |
|
|
|
|
.stream() |
|
|
|
|
.filter((difference) -> difference.type() == DifferenceType.ADDED) |
|
|
|
|
@ -65,12 +65,20 @@ class ChangelogTests {
@@ -65,12 +65,20 @@ class ChangelogTests {
|
|
|
|
|
assertThat(deprecated).hasSize(1); |
|
|
|
|
assertProperty(deprecated.get(0).oldProperty(), "test.deprecate", String.class, "wrong"); |
|
|
|
|
assertProperty(deprecated.get(0).newProperty(), "test.deprecate", String.class, "wrong"); |
|
|
|
|
List<Difference> defaultChanged = differences.differences() |
|
|
|
|
.stream() |
|
|
|
|
.filter((difference) -> difference.type() == DifferenceType.DEFAULT_CHANGED) |
|
|
|
|
.toList(); |
|
|
|
|
assertThat(defaultChanged).hasSize(2) |
|
|
|
|
.anySatisfy((entry) -> assertProperty(entry.newProperty(), "test.default.array.change", String[].class, |
|
|
|
|
new String[] { "b", "a" })) |
|
|
|
|
.anySatisfy((entry) -> assertProperty(entry.newProperty(), "test.default.change", String.class, "new")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void assertProperty(ConfigurationMetadataProperty property, String id, Class<?> type, Object defaultValue) { |
|
|
|
|
assertThat(property).isNotNull(); |
|
|
|
|
assertThat(property.getId()).isEqualTo(id); |
|
|
|
|
assertThat(property.getType()).isEqualTo(type.getName()); |
|
|
|
|
assertThat(property.getType()).isEqualTo(type.getCanonicalName()); |
|
|
|
|
assertThat(property.getDefaultValue()).isEqualTo(defaultValue); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|