use of teammates.ui.controller.ActionResult in project teammates by TEAMMATES.
the class BaseActionTest method verifyCannotAccess.
/**
* Verifies that the {@link Action} matching the {@code params} is not
* accessible to the logged in user.
* This could be one of the following ways:
* -> Unauthorised Access Exception
* ->
*/
protected void verifyCannotAccess(String... params) {
try {
Action c = gaeSimulation.getActionObject(getActionUri(), params);
ActionResult result = c.executeAndPostProcess();
String classNameOfResult = result.getClass().getName();
assertEquals(classNameOfResult, result.getClass().getName());
AssertHelper.assertContains("You are not registered in the course ", result.getStatusMessage());
} catch (UnauthorizedAccessException e) {
ignoreExpectedException();
}
}
use of teammates.ui.controller.ActionResult in project teammates by TEAMMATES.
the class ActionResultTest method testAppendParameters.
@Test
public void testAppendParameters() {
ActionResult svr = new ShowPageResult("/page/instructorHome", null, null, null);
assertEquals("/page/instructorHome", svr.getDestinationWithParams());
svr.addResponseParam(Const.ParamsNames.USER_ID, "david");
assertEquals("/page/instructorHome?user=david", svr.getDestinationWithParams());
}
Aggregations