Exemplo n.º 1
0
 @Test
 public void shouldResolveAliasFooPostRoute() {
   FullHttpRequest httpRequest =
       new DefaultFullHttpRequest(
           HttpVersion.HTTP_1_1, HttpMethod.POST, "/yada/yada.json?value=ignored");
   httpRequest.headers().add("Host", "testing-host");
   Request request = new Request(httpRequest, null);
   Action action = resolver.resolve(request);
   assertNotNull(action);
   assertEquals(HttpMethod.POST, action.getRoute().getMethod());
   assertEquals("/foo", action.getRoute().getPattern());
 }
Exemplo n.º 2
0
 @Test
 public void shouldResolveAliasCrudRouteForDelete() {
   FullHttpRequest httpRequest =
       new DefaultFullHttpRequest(
           HttpVersion.HTTP_1_1, HttpMethod.DELETE, "/blah/foo/foo23.json?value=ignored");
   httpRequest.headers().add("Host", "testing-host");
   Request request = new Request(httpRequest, null);
   Action action = resolver.resolve(request);
   assertNotNull(action);
   assertEquals(HttpMethod.DELETE, action.getRoute().getMethod());
   assertEquals("/foo/{fooId}", action.getRoute().getPattern());
 }