req.setAttribute("selectedPrivMap", selPrivMap);
EasyMock.expectLastCall().once();
EasyMock.replay( req );
//prepare the input form
final ModifyRoleForm mrf = new ModifyRoleForm();
mrf.setUserRole("student");
//execute the code to be tested
mra.modifyAssignedPrivileges( am, mrf, req, res);
//and check the results
assertTrue( "student".equals(mrf.getUserRole()) );
final String[]assignedPrivKeys = mrf.getUserRolePrivileges();
assertTrue( 2 == assignedPrivKeys.length &&
"projIdea".equals(assignedPrivKeys[0]) &&
"projDoc".equals(assignedPrivKeys[1]) );
final String[]writeAllowedPrivKeys = mrf.getPrivilegesWithWriteAllowed();
assertTrue( 2 == writeAllowedPrivKeys.length &&
"projIdea".equals(writeAllowedPrivKeys[0]) &&
null == writeAllowedPrivKeys[1] );
}