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

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


  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 ResourceNotFoundException());
    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 ResourceNotFoundException());
    doReturn(page).when(result).use(page());
   
    refererResult.redirect();
   
    verify(page).redirectTo("/no-controller");
View Full Code Here

    assertTrue(lookup.accepts(null));
  }

  @Test
  public void shouldHandle404() throws IOException, InterceptionException {
  when(translator.translate(info)).thenThrow(new ResourceNotFoundException());
   
  lookup.intercept(null, null, null);
  verify(notFoundHandler).couldntFind(info);
  }
View Full Code Here

TOP

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

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.