public void shouldUpdateGroupDefinition()

in component-test/src/main/java/org/apache/fineract/cn/group/TestGroupDefinition.java [81:103]


  public void shouldUpdateGroupDefinition ( ) throws Exception {
    final GroupDefinition randomGroupDefinition = GroupDefinitionGenerator.createRandomGroupDefinition();
    this.testSubject.createGroupDefinition(randomGroupDefinition);

    this.eventRecorder.wait(EventConstants.POST_GROUP_DEFINITION, randomGroupDefinition.getIdentifier());

    final GroupDefinition updatedGroupDefinition = GroupDefinitionGenerator.createRandomGroupDefinition();
    updatedGroupDefinition.setIdentifier(randomGroupDefinition.getIdentifier());

    this.testSubject.updateGroupDefinition(updatedGroupDefinition.getIdentifier(), updatedGroupDefinition);

    this.eventRecorder.wait(EventConstants.PUT_GROUP_DEFINITION, randomGroupDefinition.getIdentifier());

    final GroupDefinition fetchedGroupDefinition = this.testSubject.findGroupDefinition(updatedGroupDefinition.getIdentifier());
    Assert.assertNotNull(fetchedGroupDefinition);
    Assert.assertEquals(updatedGroupDefinition.getIdentifier(), fetchedGroupDefinition.getIdentifier());
    Assert.assertEquals(updatedGroupDefinition.getDescription(), fetchedGroupDefinition.getDescription());
    Assert.assertEquals(updatedGroupDefinition.getMinimalSize(), fetchedGroupDefinition.getMinimalSize());
    Assert.assertEquals(updatedGroupDefinition.getMaximalSize(), fetchedGroupDefinition.getMaximalSize());
    Assert.assertNotNull(fetchedGroupDefinition.getCycle());
    Assert.assertEquals(updatedGroupDefinition.getCycle().getNumberOfMeetings(), fetchedGroupDefinition.getCycle().getNumberOfMeetings());
    Assert.assertEquals(updatedGroupDefinition.getCycle().getFrequency(), fetchedGroupDefinition.getCycle().getFrequency());
  }