Package org.springframework.web.servlet

Examples of org.springframework.web.servlet.NoHandlerFoundException


  @Test
  public void noHandlerFoundException() {
    ServletServerHttpRequest req = new ServletServerHttpRequest(
        new MockHttpServletRequest("GET","/resource"));
    Exception ex = new NoHandlerFoundException(req.getMethod().toString(),
        req.getServletRequest().getRequestURI(),req.getHeaders());
    testException(ex);
  }
View Full Code Here


  @Test
  public void handleNoHandlerFoundException() throws Exception {
    ServletServerHttpRequest req = new ServletServerHttpRequest(
        new MockHttpServletRequest("GET","/resource"));
    NoHandlerFoundException ex = new NoHandlerFoundException(req.getMethod().name(),
        req.getServletRequest().getRequestURI(),req.getHeaders());
    ModelAndView mav = exceptionResolver.resolveException(request, response, null, ex);
    assertNotNull("No ModelAndView returned", mav);
    assertTrue("No Empty ModelAndView returned", mav.isEmpty());
    assertEquals("Invalid status code", 404, response.getStatus());
View Full Code Here

TOP

Related Classes of org.springframework.web.servlet.NoHandlerFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.