Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 public static MockHttpRequest get(String uri) throws URISyntaxException {
   MockHttpRequest request = initWithUri(uri);
   request.httpMethod = "GET";
   return request;
 }
Ejemplo n.º 3
0
 public static MockHttpRequest create(String httpMethod, URI uriObj, URI baseUri) {
   MockHttpRequest request = initWithUri(uriObj, baseUri);
   request.httpMethod = httpMethod;
   return request;
 }
Ejemplo n.º 4
0
 public static MockHttpRequest create(String httpMethod, String uri) throws URISyntaxException {
   MockHttpRequest request = initWithUri(uri);
   request.httpMethod = httpMethod;
   return request;
 }
Ejemplo n.º 5
0
 public static MockHttpRequest delete(String uri) throws URISyntaxException {
   MockHttpRequest request = initWithUri(uri);
   request.httpMethod = "DELETE";
   return request;
 }