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