Package br.com.caelum.vraptor.http.route

Examples of br.com.caelum.vraptor.http.route.ControllerNotFoundException


  public void whenRefererDontMatchAControllerShouldForwardToPage() throws Exception {
    PageResult page = mock(PageResult.class);
   
    when(request.getHeader("Referer")).thenReturn("http://localhost:8080/vraptor/no-controller");
    when(request.getContextPath()).thenReturn("/vraptor");
    when(router.parse("/no-controller", HttpMethod.GET, request)).thenThrow(new ControllerNotFoundException());
    doReturn(page).when(result).use(page());

    refererResult.forward();
   
    verify(page).forwardTo("/no-controller");
View Full Code Here


  public void whenRefererDontMatchAControllerShouldRedirectToPage() throws Exception {
    PageResult page = mock(PageResult.class);
   
    when(request.getHeader("Referer")).thenReturn("http://localhost:8080/vraptor/no-controller");
    when(request.getContextPath()).thenReturn("/vraptor");
    when(router.parse("/no-controller", HttpMethod.GET, request)).thenThrow(new ControllerNotFoundException());
    doReturn(page).when(result).use(page());
   
    refererResult.redirect();
   
    verify(page).redirectTo("/no-controller");
View Full Code Here

    observer = new RequestHandlerObserver(translator, notFoundHandler, methodNotAllowedHandler, controllerFoundEvent, requestSucceededEvent, interceptorStack, invalidInputHandler);
  }

  @Test
  public void shouldHandle404() throws Exception {
    when(translator.translate(webRequest)).thenThrow(new ControllerNotFoundException());
    observer.handle(requestStarted);
    verify(notFoundHandler).couldntFind(chain, webRequest, webResponse);
    verify(interceptorStack, never()).start();
  }
View Full Code Here

TOP

Related Classes of br.com.caelum.vraptor.http.route.ControllerNotFoundException

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.