Search in sources :

Example 1 with AdminAccountDeleteAction

use of teammates.ui.controller.AdminAccountDeleteAction in project teammates by TEAMMATES.

the class AdminAccountDeletePageActionTest method testExecuteAndPostProcess.

@Override
@Test
public void testExecuteAndPostProcess() {
    ______TS("success: delete entire account");
    InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1");
    String[] submissionParams = new String[] { Const.ParamsNames.INSTRUCTOR_ID, instructor1OfCourse1.googleId, "account", "true" };
    final String adminUserId = "admin.user";
    gaeSimulation.loginAsAdmin(adminUserId);
    AdminAccountDeleteAction deleteAction = getAction(submissionParams);
    RedirectResult result = getRedirectResult(deleteAction);
    assertNull(AccountsLogic.inst().getAccount(instructor1OfCourse1.googleId));
    assertEquals(Const.StatusMessages.INSTRUCTOR_ACCOUNT_DELETED, result.getStatusMessage());
    assertEquals(getPageResultDestination(Const.ActionURIs.ADMIN_ACCOUNT_MANAGEMENT_PAGE, false, adminUserId), result.getDestinationWithParams());
}
Also used : RedirectResult(teammates.ui.controller.RedirectResult) AdminAccountDeleteAction(teammates.ui.controller.AdminAccountDeleteAction) InstructorAttributes(teammates.common.datatransfer.attributes.InstructorAttributes) Test(org.testng.annotations.Test)

Aggregations

Test (org.testng.annotations.Test)1 InstructorAttributes (teammates.common.datatransfer.attributes.InstructorAttributes)1 AdminAccountDeleteAction (teammates.ui.controller.AdminAccountDeleteAction)1 RedirectResult (teammates.ui.controller.RedirectResult)1