#1121 - Shortcut ignored property lookups to prevent NullPointerExceptions.

This commit is contained in:
Oliver Drotbohm
2019-11-18 20:53:20 +01:00
parent fc42597091
commit aa9e449841
2 changed files with 23 additions and 3 deletions

View File

@@ -156,6 +156,14 @@ class PropertyUtilsTest {
});
}
@Test // #1121
void considersPropertyWithoutReader() throws Exception {
InputPayloadMetadata metadata = PropertyUtils.getExposedProperties(WithoutReaderMethod.class);
assertThat(metadata.getPropertyMetadata("firstname")).isPresent();
}
@Data
@AllArgsConstructor
@JsonIgnoreProperties({ "ignoreThisProperty" })
@@ -219,4 +227,13 @@ class PropertyUtilsTest {
return employee.getContent();
}
}
static class WithoutReaderMethod {
private String firstname;
public void setFirstname(String firstname) {
this.firstname = firstname;
}
}
}