in component-test/src/main/java/org/apache/fineract/cn/office/TestEmployee.java [124:142]
public void shouldDeleteEmployee() throws Exception {
final Employee employee = EmployeeFactory.createRandomEmployee();
this.organizationManager.createEmployee(employee);
this.eventRecorder.wait(EventConstants.OPERATION_POST_EMPLOYEE, employee.getIdentifier());
Assert.assertNotNull(this.organizationManager.findEmployee(employee.getIdentifier()));
{
this.organizationManager.deleteEmployee(employee.getIdentifier());
final boolean found = this.eventRecorder.wait(EventConstants.OPERATION_DELETE_EMPLOYEE, employee.getIdentifier());
Assert.assertTrue(found);
}
try {
this.organizationManager.findEmployee(employee.getIdentifier());
Assert.fail();
} catch (final NotFoundException ex) {
// do nothing, expected
}
}