DATACMNS-1609, DATACMNS-1461 - Handle null intermediates in setting auditing property paths.

We now catch the MappingException produced by trying to set auditing property paths containing null intermediate segments and ignore those. A less expensive (non-Exception-based) approach is going to be introduced for Moore as it requires API changes to the property path setting APIs.

Related tickets: DATACMNS-1438.
This commit is contained in:
Oliver Drotbohm
2019-01-09 21:38:21 +01:00
committed by Christoph Strobl
parent f7398f490e
commit 71a42664c2
2 changed files with 26 additions and 5 deletions

View File

@@ -212,6 +212,16 @@ public class MappingAuditableBeanWrapperFactoryUnitTests {
});
}
@Test // DATACMNS-1461
public void skipsNullIntermediatesWhenSettingProperties() {
WithEmbedded withEmbedded = new WithEmbedded();
assertThat(factory.getBeanWrapperFor(withEmbedded)).hasValueSatisfying(it -> {
assertThatCode(() -> it.setCreatedBy("user")).doesNotThrowAnyException();
});
}
private void assertLastModificationDate(Object source, TemporalAccessor expected) {
Sample sample = new Sample();