コード例 #1
0
 @Test
 public void shouldOnEmailAddressNotUpdateAnythingIfErrors() {
   EmailAddress expectedEmailAddress = new EmailAddress("invalid");
   setupUpdateEmailAddress(expectedEmailAddress.getEmailAddress());
   when(bindingResult.hasErrors()).thenReturn(true);
   underTest.updateCommunicationEmailAddress(
       request, response, false, expectedEmailAddress, bindingResult, modelMap);
   verifyNoUpdatesDone();
 }
コード例 #2
0
 @Test
 public void shouldOnErrorsForUpdateEmailAddressReturnMainFormAgain() {
   EmailAddress expectedEmailAddress = new EmailAddress("invalid");
   setupUpdateEmailAddress(expectedEmailAddress.getEmailAddress());
   when(bindingResult.hasErrors()).thenReturn(true);
   assertMainProfilePageViewName(
       underTest.updateCommunicationEmailAddress(
           request, response, false, expectedEmailAddress, bindingResult, modelMap));
 }
コード例 #3
0
 @Test
 public void shouldOnErrorsForUpdateEmailAddressReturnPlayerObjectAgain() {
   EmailAddress expectedEmailAddress = new EmailAddress("dont@@hit.me");
   PlayerProfile expectedUserProfile =
       setupUpdateEmailAddress(expectedEmailAddress.getEmailAddress());
   when(bindingResult.hasErrors()).thenReturn(true);
   underTest.updateCommunicationEmailAddress(
       request, response, false, expectedEmailAddress, bindingResult, modelMap);
   assertModelMapContainsPlayerObject(expectedUserProfile);
 }