@Test
public void should_set_changing_principal()
{
// given
AuditedEntity entity = new AuditedEntity();
// when
entityManager.persist(entity);
entityManager.flush();
// then
assertNotNull(entity.getChanger());
assertEquals(who, entity.getChanger());
assertNotNull(entity.getPrincipal());
assertEquals(who, entity.getPrincipal().getName());
}