@Test
@Transactional
public void testCreateEnforcementJob() throws Exception {

    Date firstExecuted = new Date();
    IAgreement agreement = saveAgreement();
    EnforcementJob job = new EnforcementJob();
    job.setAgreement(agreement);
    job.setEnabled(true);
    job.setFirstExecuted(firstExecuted);
    Date lastExecuted = new Date();
    job.setLastExecuted(lastExecuted);
    
    IEnforcementJob stored = service.createEnforcementJob(job);
    assertTrue(stored.getId() != null);
    stored = enforcementJobDao.getById(stored.getId());
    assertEquals(job.getEnabled(), stored.getEnabled());
    assertEquals(job.getFirstExecuted(), stored.getFirstExecuted());
    assertEquals(job.getLastExecuted(), stored.getLastExecuted());
}