public void testDeletePharaohRoleFails()

in component-test/src/main/java/TestRoles.java [181:196]


  public void testDeletePharaohRoleFails() throws InterruptedException {

    try (final AutoUserContext ignore = loginAdmin()) {
      final Role adminRole = getTestSubject().getRole(ADMIN_ROLE);
      try {
        getTestSubject().deleteRole(ADMIN_ROLE);
        Assert.fail("It should not be possible to delete the admin role.");
      }
      catch (final IllegalArgumentException expected) {
        //noinspection EmptyCatchBlock
      }

      final Role adminRoleStillThere = getTestSubject().getRole(ADMIN_ROLE);
      Assert.assertEquals(adminRole, adminRoleStillThere);
    }
  }