Class BaseControllerTestCase<T extends BaseController>

    • Field Detail

      • myModelAndView

        protected org.springframework.web.servlet.ModelAndView myModelAndView
    • Constructor Detail

      • BaseControllerTestCase

        public BaseControllerTestCase()
    • Method Detail

      • processRequest

        protected org.springframework.web.servlet.ModelAndView processRequest​(javax.servlet.http.HttpServletRequest request)
                                                                       throws Exception
        Throws:
        Exception
      • preHandle

        protected boolean preHandle​(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response)
                             throws Exception
        Throws:
        Exception
      • postHandle

        protected void postHandle​(javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response,
                                  Object handler,
                                  org.springframework.web.servlet.ModelAndView modelAndView)
                           throws Exception
        Throws:
        Exception
      • processRequest

        protected org.springframework.web.servlet.ModelAndView processRequest()
                                                                       throws Exception
        Throws:
        Exception
      • getModel

        protected final Map getModel()
      • getView

        protected final org.springframework.web.servlet.View getView()
      • getViewName

        protected final String getViewName()
      • processEmptyRequest

        protected final org.springframework.web.servlet.ModelAndView processEmptyRequest()
                                                                                  throws Exception
        Throws:
        Exception
      • doGoodParameterTest

        protected org.springframework.web.servlet.ModelAndView doGoodParameterTest​(javax.servlet.http.HttpServletRequest request,
                                                                                   String expectedViewName,
                                                                                   String key,
                                                                                   Object expectedModel)
                                                                            throws Exception
        Throws:
        Exception
      • doGoodParameterTest

        protected org.springframework.web.servlet.ModelAndView doGoodParameterTest​(javax.servlet.http.HttpServletRequest request,
                                                                                   String expectedViewName,
                                                                                   String[] key,
                                                                                   Object[] expectedModel)
                                                                            throws Exception
        Throws:
        Exception
      • doPost

        protected org.springframework.web.servlet.ModelAndView doPost​(Object... params)
                                                               throws Exception
        TBD
        Parameters:
        params - flatten pairs of parameters, the first one is the parameter name and the second one is the parameter value.
        Returns:
        Throws:
        Exception
      • doGet

        protected org.springframework.web.servlet.ModelAndView doGet​(Object... params)
                                                              throws Exception
        Throws:
        Exception
      • doHead

        protected org.springframework.web.servlet.ModelAndView doHead​(Object... params)
                                                               throws Exception
        Throws:
        Exception
      • setRealUserAgentForRequest

        protected void setRealUserAgentForRequest()
      • assertRedirect2AdminOverview

        protected void assertRedirect2AdminOverview()
      • assertView

        protected void assertView​(String expectedViewName)
      • assertRedirect

        protected void assertRedirect​(@Nullable
                                      String redirectedTo)
      • assertRedirectMatches

        protected void assertRedirectMatches​(@NotNull
                                             List<org.hamcrest.Matcher<String>> matchers)
      • assertResponseHas

        protected void assertResponseHas​(String what)
      • assertResponseHasWithCount

        protected void assertResponseHasWithCount​(String what,
                                                  int count)
      • assertResponseHasNot

        protected void assertResponseHasNot​(String what)
      • assertSimpleView

        protected void assertSimpleView​(String expectedMessage)
      • assertResponseHasStatusNotFound

        protected void assertResponseHasStatusNotFound​(@Nullable
                                                       String statusText)
      • checkResponseHasNoErrors

        protected void checkResponseHasNoErrors()