  @Test
  public void testSaveFailsWhenKeyChanged() {


    TestUtil.login("admin", ApplicationAccessControlConfig.PERMISSION_FIND_KEY_LIST,
        ApplicationAccessControlConfig.PERMISSION_SAVE_KEY_LIST);
    KeyListEto keyList = this.keymanagement.findKeyListByKey(KeyListCountryTestAspect.KEY_COUNTRY);
    KeyListCountryTestAspect.verifyCountry(keyList);
    keyList.setKey("modifiedKey");
    try {
      this.keymanagement.saveKeyList(keyList);
      failBecauseExceptionWasNotThrown(KeyModificationException.class);
    } catch (KeyModificationException e) {
      assertThat(e.getMessage()).contains(
          "You can not change the business key of entity KeyListEntity[id=1,key=country] to modifiedKey! If you really need to change the business key, create a new entity and delete the old one.");
    }
  }