コード例 #1
0
 @Test(expected = RoutingException.class)
 public void testPut() throws RoutingException {
   Routes.load(ResourceUtil.getResourceAsFile("routes/via.xml"));
   System.out.println(Routes.getRouteSet().toString());
   MockHttpServletRequest request = ((MockHttpServletRequest) RequestUtil.getRequest());
   request.setMethod("PUT");
   Routes.recognizePath("/methods/");
 }
コード例 #2
0
  @Test
  public void testPost() {
    Routes.load(ResourceUtil.getResourceAsFile("routes/via.xml"));
    System.out.println(Routes.getRouteSet().toString());
    MockHttpServletRequest request = ((MockHttpServletRequest) RequestUtil.getRequest());
    request.setMethod("POST");
    Options options = Routes.recognizePath("/methods/");
    System.out.println(options);

    assertThat(options.getString("action"), is("getAndPost"));
  }