This commit is contained in:
Phillip Webb
2015-07-16 12:56:49 -07:00
parent 4405ae4eaf
commit 728e64b929
19 changed files with 136 additions and 113 deletions

View File

@@ -416,13 +416,12 @@ public class ConfigurationMetadataAnnotationProcessorTests {
@Test
public void mergingOfAdditionalDeprecation() throws Exception {
writePropertyDeprecation(ItemMetadata.newProperty("simple", "wrongName", "java.lang.String",
null, null, null, null, new ItemDeprecation("Lame name.", "simple.the-name")));
writePropertyDeprecation(ItemMetadata.newProperty("simple", "wrongName",
"java.lang.String", null, null, null, null, new ItemDeprecation(
"Lame name.", "simple.the-name")));
ConfigurationMetadata metadata = compile(SimpleProperties.class);
assertThat(
metadata,
containsProperty("simple.wrong-name", String.class)
.withDeprecation("Lame name.", "simple.the-name"));
assertThat(metadata, containsProperty("simple.wrong-name", String.class)
.withDeprecation("Lame name.", "simple.the-name"));
}
@Test

View File

@@ -165,12 +165,14 @@ public class ConfigurationMetadataMatchers {
public ContainsItemMatcher ofType(Class<?> dataType) {
return new ContainsItemMatcher(this.itemType, this.name, dataType.getName(),
this.sourceType, this.description, this.defaultValue, this.deprecation);
this.sourceType, this.description, this.defaultValue,
this.deprecation);
}
public ContainsItemMatcher ofType(String dataType) {
return new ContainsItemMatcher(this.itemType, this.name, dataType,
this.sourceType, this.description, this.defaultValue, this.deprecation);
this.sourceType, this.description, this.defaultValue,
this.deprecation);
}
public ContainsItemMatcher fromSource(Class<?> sourceType) {
@@ -190,7 +192,8 @@ public class ConfigurationMetadataMatchers {
public ContainsItemMatcher withDeprecation(String reason, String replacement) {
return new ContainsItemMatcher(this.itemType, this.name, this.type,
this.sourceType, this.description, this.defaultValue, new ItemDeprecation(reason, replacement));
this.sourceType, this.description, this.defaultValue,
new ItemDeprecation(reason, replacement));
}
private ItemMetadata getFirstItemWithName(ConfigurationMetadata metadata,