@Test
public void testHandleCreatedCreatesANewComplianceStatusAndSetsDateToStatusDate() throws Exception {
handler = new ComplianceHandler(mapper, complianceCurator);
Event event = new Event();
event.setNewEntity("test-string");
Date expectedDate = new Date();
ComplianceStatus status = new ComplianceStatus(expectedDate, "VALID");
// Date is null here -- expected to be filled in with the status date.
Compliance snap = new Compliance(null, new Consumer(), status);
when(mapper.readValue(eq(event.getNewEntity()), eq(Compliance.class))).thenReturn(snap);
handler.handleCreated(event);
verify(complianceCurator).create(eq(snap));
assertEquals(snap.getStatus().getDate(), snap.getDate());
}