DATACMNS-957 - AuditingHandler now works with entities without an identifier.
Entities without an identifier previously an exception because the IsNewStrategyFactory wasn't able to determine a strategy even if there was no auditing to be applied in the first place. We now eagerly check for auditability and skip the lookup for an IsNewStrategy completely in case that check returns false. Related pull request: #189.
This commit is contained in:
@@ -92,8 +92,15 @@ public class IsNewAwareAuditingHandlerUnitTests extends AuditingHandlerUnitTests
|
||||
handler.markModified(null);
|
||||
}
|
||||
|
||||
@Test // DATACMNS-957
|
||||
public void skipsEntityWithoutIdentifier() {
|
||||
getHandler().markAudited(new EntityWithoutId());
|
||||
}
|
||||
|
||||
static class Domain {
|
||||
|
||||
@Id Long id;
|
||||
}
|
||||
|
||||
static class EntityWithoutId {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user