@Test
 public void testSaveAndProceedNext_UnverifiedNewUser() {
   getAccountConfigurationData().getRoles().add(INVESTIGATOR);
   setUpGridSessionInformation(INVESTIGATOR.getGroupName());
   assertEquals(
       VerificationPageFlowAction.FUNCTIONALITY_WARNING_RETURN, action.saveAndProceedNext());
 }
 @Test
 public void testSaveAndProceedNext_ExistingUser()
     throws ValidationException, GridInvocationException {
   FirebirdWebTestUtility.setCurrentUser(action, user);
   assertEquals(VerificationPageFlowAction.MY_ACCOUNT_RETURN, action.saveAndProceedNext());
   verify(mockAccountService).addRoles(user, action.getAccountConfigurationData());
   verify(getMockSession()).setAttribute(FirebirdUIConstants.ROLES_UPDATED, true);
 }
 @Test
 public void testSaveAndProceedNext_GridInvocationException()
     throws ValidationException, GridInvocationException {
   FirebirdWebTestUtility.setCurrentUser(action, user);
   GridInvocationException mockGridInvocationException = mock(GridInvocationException.class);
   doThrow(mockGridInvocationException)
       .when(mockAccountService)
       .addRoles(eq(user), any(AccountConfigurationData.class));
   assertEquals(ActionSupport.INPUT, action.saveAndProceedNext());
   assertTrue(action.hasActionErrors());
 }
 @Test
 public void testSaveAndProceedNext_ValidationError()
     throws ValidationException, GridInvocationException {
   ValidationFailure validationFailure = new ValidationFailure("failed");
   ValidationResult result = new ValidationResult(validationFailure);
   ValidationException validationException = new ValidationException(result);
   doThrow(validationException)
       .when(mockAccountService)
       .create(any(AccountConfigurationData.class));
   assertEquals(ActionSupport.INPUT, action.saveAndProceedNext());
 }
 @Test
 public void testSaveAndProceedNext_VerifiedRoles() {
   getAccountConfigurationData().getRoles().add(INVESTIGATOR);
   setUpGridSessionInformation(INVESTIGATOR.getGroupName(), INVESTIGATOR.getVerifiedGroupName());
   assertEquals(VerificationPageFlowAction.USER_HOME_RETURN, action.saveAndProceedNext());
 }
 @Test
 public void testSaveAndProceedNext_NewUser() throws ValidationException, GridInvocationException {
   assertEquals(VerificationPageFlowAction.USER_HOME_RETURN, action.saveAndProceedNext());
   verify(mockAccountService).create(action.getAccountConfigurationData());
 }