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:
committed by
Christoph Strobl
parent
f7398f490e
commit
71a42664c2
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user