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

    Boolean expectedPartialValue = Boolean.TRUE;
    request.setParameter(AbstractProfileController.PARTIAL_URI_FLAG, "true");
    ModelAndView modelAndViewUnderTest =
        underTest.resolveException(
            request, response, null, new MaxUploadSizeExceededException(maxUploadSize));

    assertEquals(
        expectedPartialValue,
        modelAndViewUnderTest.getModel().get(AbstractProfileController.PARTIAL_URI_FLAG));

    request.setParameter(AbstractProfileController.PARTIAL_URI_FLAG, "false");
    modelAndViewUnderTest =
        underTest.resolveException(
            request, response, null, new MaxUploadSizeExceededException(maxUploadSize));
    ProfileTestHelper.assertPartialFlagSetCorrectly(modelAndViewUnderTest, false);
  }
コード例 #2
0
 private void assertMainProfilePagePartialViewName(ModelAndView actualModelAndView) {
   ProfileTestHelper.assertPartialLayout(actualModelAndView);
   ProfileTestHelper.assertSelectTabIs(actualModelAndView, "player");
 }
コード例 #3
0
 @Test
 public void shouldContainAvailableTabs() {
   setUpPlayerProfile();
   ProfileTestHelper.assertFullListOfTabsInModel(
       underTest.getMainProfilePage(modelMap, request, response, true));
 }