assert mybool.getErrorMessage().indexOf("Not a valid boolean") > 0;
}
@Test(enabled = ENABLE_TESTS)
public void testNoPermissionCallback() throws Exception {
Subject superuser = LookupUtil.getSubjectManager().getOverlord();
Subject noPermSubject = new Subject("userWithNoPermissions", true, false);
Resource resource = newResource1;
try {
noPermSubject = LookupUtil.getSubjectManager().createSubject(superuser, noPermSubject);
noPermSubject = createSession(noPermSubject);
try {
configurationManager.updateResourceConfiguration(noPermSubject, resource.getId(), new Configuration());
assert false : "Should not have been updated - user didn't have permissions";
} catch (PermissionException expected) {
System.out.println("This was expected and OK:\n" + expected);
}
try {
configurationManager.updatePluginConfiguration(noPermSubject, resource.getId(), new Configuration());
assert false : "Should not have been updated - user didn't have permissions";
} catch (PermissionException expected) {
System.out.println("This was expected and OK:\n" + expected);
expected.printStackTrace();
}
} finally {
LookupUtil.getSubjectManager().deleteUsers(LookupUtil.getSubjectManager().getOverlord(),
new int[] { noPermSubject.getId() });
}
}