public void documentUpdateAssignedEmployee()

in component-test/src/main/java/org/apache/fineract/cn/group/GroupApiDocumentation.java [542:565]


  public void documentUpdateAssignedEmployee ( ) throws Exception {

    final GroupDefinition randomGroupDefinition = GroupDefinitionGenerator.createRandomGroupDefinition();
    this.testSubject.createGroupDefinition(randomGroupDefinition);
    this.eventRecorder.wait(EventConstants.POST_GROUP_DEFINITION, randomGroupDefinition.getIdentifier());

    final Group randomGroup = GroupGenerator.createRandomGroup(randomGroupDefinition.getIdentifier());
    this.testSubject.createGroup(randomGroup);
    this.eventRecorder.wait(EventConstants.POST_GROUP, randomGroup.getIdentifier());

    final AssignedEmployeeHolder anotherEmployee = new AssignedEmployeeHolder();
    anotherEmployee.setIdentifier("Emply" + RandomStringUtils.randomAlphanumeric(3));

    Gson gson = new Gson();
    this.mockMvc.perform(put("/groups/" + randomGroup.getIdentifier() + "/employee")
            .accept(MediaType.ALL_VALUE)
            .contentType(MediaType.APPLICATION_JSON_VALUE)
            .content(gson.toJson(anotherEmployee)))
            .andExpect(status().isAccepted())
            .andDo(document("document-update-assigned-employee", preprocessRequest(prettyPrint()),
                    requestFields(
                            fieldWithPath("identifier").description("Assigned employee identifier")
                    )));
  }