public static MockHttpRequest deepCopy(HttpRequest request) throws IOException { MockHttpRequest mock = new MockHttpRequest(); mock.uri = request.getUri(); mock.httpHeaders = (ResteasyHttpHeaders) request.getHttpHeaders(); mock.httpMethod = request.getHttpMethod(); byte[] bytes = ReadFromStream.readFromStream(1024, request.getInputStream()); mock.inputStream = new ByteArrayInputStream(bytes); return mock; }
public static MockHttpRequest get(String uri) throws URISyntaxException { MockHttpRequest request = initWithUri(uri); request.httpMethod = "GET"; return request; }
public static MockHttpRequest create(String httpMethod, URI uriObj, URI baseUri) { MockHttpRequest request = initWithUri(uriObj, baseUri); request.httpMethod = httpMethod; return request; }
public static MockHttpRequest create(String httpMethod, String uri) throws URISyntaxException { MockHttpRequest request = initWithUri(uri); request.httpMethod = httpMethod; return request; }
public static MockHttpRequest delete(String uri) throws URISyntaxException { MockHttpRequest request = initWithUri(uri); request.httpMethod = "DELETE"; return request; }