[Minor] Fixed tests

This commit is contained in:
Robert von Burg 2016-09-29 17:04:46 +02:00
parent c6506de3ab
commit d7931f101e
3 changed files with 5 additions and 4 deletions

View File

@ -63,7 +63,7 @@ public class PrivilegePolicyHelper {
// first check values not allowed
if (privilege.isDenied(privilegeValue)) {
// then throw access denied
String msg = MessageFormat.format(PrivilegeMessages.getString("Privilege.accessdenied.noprivilege"), //$NON-NLS-1$
String msg = MessageFormat.format(PrivilegeMessages.getString("Privilege.accessdenied.noprivilege.value"), //$NON-NLS-1$
ctx.getUsername(), privilege.getName(), privilegeValue, restrictable.getClass().getName());
throw new AccessDeniedException(msg);
}
@ -73,7 +73,7 @@ public class PrivilegePolicyHelper {
return;
// default is not allowed
String msg = MessageFormat.format(PrivilegeMessages.getString("Privilege.accessdenied.noprivilege"), //$NON-NLS-1$
String msg = MessageFormat.format(PrivilegeMessages.getString("Privilege.accessdenied.noprivilege.value"), //$NON-NLS-1$
ctx.getUsername(), privilege.getName(), privilegeValue, restrictable.getClass().getName());
throw new AccessDeniedException(msg);
}

View File

@ -1,4 +1,5 @@
Privilege.accessdenied.noprivilege=User {0} does not have the privilege {1} with value {2} needed for Restrictable {3}
Privilege.accessdenied.noprivilege=User {0} does not have the privilege {1} needed for Restrictable {2}
Privilege.accessdenied.noprivilege.value=User {0} does not have the privilege {1} with value {2} needed for Restrictable {3}
Privilege.illegalArgument.nonstring=\ {0} has returned a non-string privilege value\!
Privilege.illegalArgument.nonrole=\ {0} did not return a Role privilege value\!
Privilege.illegalArgument.noncertificate=\ {0} did not return a Certificate privilege value\!

View File

@ -201,7 +201,7 @@ public class PrivilegeTest extends AbstractPrivilegeTest {
public void testPerformSystemRestrictableFailNoAdditionalPrivilege() throws Exception {
this.exception.expect(PrivilegeException.class);
this.exception.expectMessage(
"User system_admin2 does not have the privilege li.strolch.privilege.handler.SystemAction needed for Restrictable li.strolch.privilege.test.model.TestSystemUserActionDeny");
"User system_admin2 does not have the privilege li.strolch.privilege.handler.SystemAction with value li.strolch.privilege.test.model.TestSystemUserActionDeny needed for Restrictable li.strolch.privilege.test.model.TestSystemUserActionDeny");
try {
// create the action to be performed as a system user
TestSystemUserActionDeny action = new TestSystemUserActionDeny();