Package br.com.caelum.vraptor.controller

Examples of br.com.caelum.vraptor.controller.ControllerMethod


    when(request.getRequestURI()).thenReturn("/url");
    when(request.getMethod()).thenReturn("POST");
    when(router.parse("/url", HttpMethod.POST,webRequest)).thenReturn(method);

    ControllerMethod controller = translator.translate(webRequest);
    assertThat(controller, is(equalTo(method)));
  }
View Full Code Here


  public void shouldAcceptCaseInsensitiveRequestMethods() {
    when(request.getRequestURI()).thenReturn("/url");
    when(request.getMethod()).thenReturn("pOsT");
    when(router.parse("/url", HttpMethod.POST,webRequest)).thenReturn(method);

    ControllerMethod controller = translator.translate(webRequest);

    assertThat(controller, is(equalTo(method)));
  }
View Full Code Here

    when(request.getRequestURI()).thenReturn("/url");
    when(request.getParameter("_method")).thenReturn("gEt");
    when(request.getMethod()).thenReturn("POST");
    when(router.parse("/url", HttpMethod.GET, webRequest)).thenReturn(method);

    ControllerMethod controller = translator.translate(webRequest);
    assertThat(controller, is(equalTo(method)));
  }
View Full Code Here

    when(request.getRequestURI()).thenReturn("/url");
    when(request.getParameter("_method")).thenReturn("DELETE");
    when(request.getMethod()).thenReturn("POST");
    when(router.parse("/url", HttpMethod.DELETE, webRequest)).thenReturn(method);

    ControllerMethod controller = translator.translate(webRequest);
    assertThat(controller, is(equalTo(method)));
  }
View Full Code Here

    when(request.getRequestURI()).thenReturn("/url");
    when(request.getContextPath()).thenReturn("");
    when(request.getMethod()).thenReturn("GET");
    when(router.parse("/url", HttpMethod.GET, webRequest)).thenReturn(method);

    ControllerMethod controller = translator.translate(webRequest);
    assertThat(controller, is(equalTo(method)));

  }
View Full Code Here

    when(request.getRequestURI()).thenReturn("/custom_context/url");
    when(request.getContextPath()).thenReturn("/custom_context");
    when(request.getMethod()).thenReturn("GET");
    when(router.parse("/url", HttpMethod.GET, webRequest)).thenReturn(method);

    ControllerMethod controller = translator.translate(webRequest);
    assertThat(controller, is(equalTo(method)));
  }
View Full Code Here

  public void canHandleUrlIfPlainRootContext() {
    when(request.getRequestURI()).thenReturn("/");
    when(request.getMethod()).thenReturn("GET");
    when(router.parse("/", HttpMethod.GET, webRequest)).thenReturn(method);

    ControllerMethod controller = translator.translate(webRequest);
    assertThat(controller, is(equalTo(method)));
     }
View Full Code Here

  public void canHandleComposedUrlIfPlainRootContext() {
    when(request.getRequestURI()).thenReturn("/products/1");
    when(request.getMethod()).thenReturn("GET");
    when(router.parse("/products/1", HttpMethod.GET, webRequest)).thenReturn(method);

    ControllerMethod controller = translator.translate(webRequest);
    assertThat(controller, is(equalTo(method)));
  }
View Full Code Here

    when(request.getRequestURI()).thenReturn("/custom_context/products/1");
    when(request.getContextPath()).thenReturn("/custom_context");
    when(request.getMethod()).thenReturn("GET");
    when(router.parse("/products/1", HttpMethod.GET, webRequest)).thenReturn(method);

    ControllerMethod controller = translator.translate(webRequest);
    assertThat(controller, is(equalTo(method)));
  }
View Full Code Here

    when(request.getRequestURI()).thenReturn("/custom_context/");
    when(request.getContextPath()).thenReturn("/custom_context");
    when(request.getMethod()).thenReturn("GET");
    when(router.parse("/", HttpMethod.GET, webRequest)).thenReturn(method);

    ControllerMethod controller = translator.translate(webRequest);
    assertThat(controller, is(equalTo(method)));
  }
View Full Code Here

TOP

Related Classes of br.com.caelum.vraptor.controller.ControllerMethod

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.