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