@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/"); }
@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")); }