@Test public void testHandle() throws URISyntaxException { RESTResponse response = invoke(testee, "GET", "hello", ""); assertEquals(200, response.getHttpCode()); assertEquals("Hello World!", new String(response.getBody())); }
public final RESTResponse handle(URI baseUri, URI requestUri, String method, byte[] body, Map<String, List<String>> headers) { final ResponseWriter responseWriter = new ResponseWriter(); final ContainerRequest requestContext = new ContainerRequest(baseUri, requestUri, method, getSecurityContext(), new MapPropertiesDelegate()); requestContext.setEntityStream(new ByteArrayInputStream(body)); requestContext.getHeaders().putAll(headers); requestContext.setWriter(responseWriter); try { appHandler.handle(requestContext); } finally { responseWriter.commit(); } return responseWriter.getResponse(); }
RESTService extends Service { public final RESTResponse handle(URI baseUri, URI requestUri, String method, byte[] body, Map<String, List<String>> headers) { final ResponseWriter responseWriter = new ResponseWriter(); final ContainerRequest requestContext = new ContainerRequest(baseUri, requestUri, method, getSecurityContext(), new MapPropertiesDelegate()); requestContext.setEntityStream(new ByteArrayInputStream(body)); requestContext.getHeaders().putAll(headers); requestContext.setWriter(responseWriter); try { appHandler.handle(requestContext); } finally { responseWriter.commit(); } return responseWriter.getResponse(); } }
RESTService extends Service { public final RESTResponse handle(URI baseUri, URI requestUri, String method, byte[] body, Map<String, List<String>> headers) { final ResponseWriter responseWriter = new ResponseWriter(); final ContainerRequest requestContext = new ContainerRequest(baseUri, requestUri, method, getSecurityContext(), new MapPropertiesDelegate()); requestContext.setEntityStream(new ByteArrayInputStream(body)); requestContext.getHeaders().putAll(headers); requestContext.setWriter(responseWriter); try { appHandler.handle(requestContext); } finally { responseWriter.commit(); } return responseWriter.getResponse(); } RESTService(); }
RESTService extends Service { public final RESTResponse handle(URI baseUri, URI requestUri, String method, byte[] body, Map<String, List<String>> headers) { final ResponseWriter responseWriter = new ResponseWriter(); final ContainerRequest requestContext = new ContainerRequest(baseUri, requestUri, method, getSecurityContext(), new MapPropertiesDelegate()); requestContext.setEntityStream(new ByteArrayInputStream(body)); requestContext.getHeaders().putAll(headers); requestContext.setWriter(responseWriter); try { appHandler.handle(requestContext); } finally { responseWriter.commit(); } return responseWriter.getResponse(); } RESTService(); final RESTResponse handle(URI baseUri, URI requestUri, String method, byte[] body,
			Map<String, List<String>> headers); final String getSwagger(); @Override final String getAlias(); }
RESTService extends Service { public final RESTResponse handle(URI baseUri, URI requestUri, String method, byte[] body, Map<String, List<String>> headers) { final ResponseWriter responseWriter = new ResponseWriter(); final ContainerRequest requestContext = new ContainerRequest(baseUri, requestUri, method, getSecurityContext(), new MapPropertiesDelegate()); requestContext.setEntityStream(new ByteArrayInputStream(body)); requestContext.getHeaders().putAll(headers); requestContext.setWriter(responseWriter); try { appHandler.handle(requestContext); } finally { responseWriter.commit(); } return responseWriter.getResponse(); } RESTService(); final RESTResponse handle(URI baseUri, URI requestUri, String method, byte[] body,
			Map<String, List<String>> headers); final String getSwagger(); @Override final String getAlias();  }