//3. delete a role and ensure it gives status code as insufficient permission
//1. create a gatekeeper that allows developer
MockGateKeeper mockGateKeeper = new MockGateKeeper();
mockGateKeeper.allowRoleToUser("test@example.com", Role.PORTAL_ADMIN);
AdminAPI api = new AdminAPI();
api.setGateKeeper(mockGateKeeper);
//2. add a role
User user = UserServiceFactory.getUserService().getCurrentUser();
String role = "testdummy";
APIResponse resp = api.addRole(role, user);
assertTrue("add should give insufficient permission error",
resp.statusCode == Status.ERROR_INSUFFICIENT_PERMISSION);
//3. rename a role
resp = api.renameRole(role, role + "_new", user);
assertTrue("rename should give insufficient permission error",
resp.statusCode == Status.ERROR_INSUFFICIENT_PERMISSION);
//4. delete a role
resp = api.deleteRole(role, user);
assertTrue("delete should give insufficient permission error",
resp.statusCode == Status.ERROR_INSUFFICIENT_PERMISSION);
}