public void shouldCreateEmployee()

in component-test/src/main/java/org/apache/fineract/cn/office/TestEmployee.java [41:59]


  public void shouldCreateEmployee() throws Exception {
    final Employee employee = EmployeeFactory.createRandomEmployee();
    {
      super.organizationManager.createEmployee(employee);
      final boolean found = this.eventRecorder.wait(EventConstants.OPERATION_POST_EMPLOYEE, employee.getIdentifier());
      Assert.assertTrue(found);
    }

    final Employee savedEmployee = this.organizationManager.findEmployee(employee.getIdentifier());

    Assert.assertNotNull(savedEmployee);
    Assert.assertEquals(employee.getIdentifier(), savedEmployee.getIdentifier());
    Assert.assertEquals(employee.getGivenName(), savedEmployee.getGivenName());
    Assert.assertEquals(employee.getMiddleName(), savedEmployee.getMiddleName());
    Assert.assertEquals(employee.getSurname(), savedEmployee.getSurname());

    this.organizationManager.deleteEmployee(employee.getIdentifier());
    this.eventRecorder.wait(EventConstants.OPERATION_DELETE_EMPLOYEE, employee.getIdentifier());
  }