public void shouldNotUpdateOfficeIdentifierMismatch()

in component-test/src/main/java/org/apache/fineract/cn/office/TestOffice.java [92:108]


  public void shouldNotUpdateOfficeIdentifierMismatch() throws Exception {
    final Office office = OfficeFactory.createRandomOffice();
    this.organizationManager.createOffice(office);
    this.eventRecorder.wait(EventConstants.OPERATION_POST_OFFICE, office.getIdentifier());

    final String originalIdentifier = office.getIdentifier();
    office.setIdentifier(RandomStringUtils.randomAlphanumeric(32));

    try {
      this.organizationManager.updateOffice(originalIdentifier, office);
      Assert.fail();
    } catch (final BadRequestException ex) {
      // do nothing, expected
    }
    this.organizationManager.deleteOffice(originalIdentifier);
    this.eventRecorder.wait(EventConstants.OPERATION_DELETE_OFFICE, office.getIdentifier());
  }