@Test
public void testSaveAuthor() {
prepareAuditingUser();
Author author = createAuthor();
// check no authors are persisted
List<Author> existentAuthors = authorRepository.findAll();
assertTrue(existentAuthors.isEmpty());
authorRepository.save(author);
existentAuthors = authorRepository.findAll();
assertEquals("Simon Becket expected to be persisted", 1,
existentAuthors.size());
// check if auditing was done
Author check = existentAuthors.get(0);
assertNotNull("createdBy expected", check.getCreatedBy());
assertNotNull("created date expected", check.getCreatedDate());
assertEquals(author.geteMail(), check.geteMail());
}