コード例 #1
0
  @Test
  public void resolveExceptionShouldSetCountries() {
    long maxUploadSize = 1000;
    setUpPlayerProfile();

    final ModelAndView modelAndViewUnderTest =
        underTest.resolveException(
            request, response, null, new MaxUploadSizeExceededException(maxUploadSize));
    assertSame(
        countryRepository.getCountries(), modelAndViewUnderTest.getModelMap().get("countries"));
  }
コード例 #2
0
  @Before
  public void setUp() {
    MockitoAnnotations.initMocks(this);

    when(yazinoConfiguration.getBoolean(anyString())).thenReturn(true);

    when(countryRepository.getCountries()).thenReturn(expectedCountries);
    modelMap = new ModelMap();

    request = new MockHttpServletRequest();
    response = new MockHttpServletResponse();
    underTest =
        new PlayerProfileController(
            lobbySessionCache,
            playerProfileService,
            avatarRepository,
            lobbyExceptionHandler,
            passwordChangeFormValidator,
            playerProfileCacheRemovalListener,
            yazinoConfiguration,
            genderRepository,
            countryRepository,
            playerService);
  }