@Test public void shouldClearPlayerProfileCacheOnUpdateOfDisplayNameForUser() { final DisplayName expectedDisplayName = new DisplayName("Super Cool New Name"); final PlayerProfile userProfile = setupUpdateDisplayName(expectedDisplayName.getDisplayName()); underTest.updateDisplayName( request, response, false, expectedDisplayName, bindingResult, modelMap); verify(playerProfileCacheRemovalListener).playerUpdated(userProfile.getPlayerId()); }
@Test public void shouldUpdateDisplayNameForUserAndRedirectToOriginalForm() { DisplayName expectedDisplayName = new DisplayName("Super Cool New Name"); setupUpdateDisplayName(expectedDisplayName.getDisplayName()); assertRedirectToMainProfilePage( underTest.updateDisplayName( request, response, false, expectedDisplayName, bindingResult, modelMap)); assertModelMapIsEmptyToAvoidQueryStringOnRedirect(modelMap); }
@Test public void shouldUpdateDisplayNameForUser() { DisplayName expectedDisplayName = new DisplayName("Super Cool New Name"); PlayerProfile userProfile = setupUpdateDisplayName(expectedDisplayName.getDisplayName()); underTest.updateDisplayName( request, response, false, expectedDisplayName, bindingResult, modelMap); verify(playerProfileService) .updateDisplayName(userProfile.getPlayerId(), expectedDisplayName.getDisplayName()); }