com.google.api.client.testing.http
Class MockLowLevelHttpRequest

java.lang.Object
  extended by com.google.api.client.http.LowLevelHttpRequest
      extended by com.google.api.client.testing.http.MockLowLevelHttpRequest

public class MockLowLevelHttpRequest
extends LowLevelHttpRequest

Mock for LowLevelHttpRequest.

Since:
1.3
Author:
Yaniv Inbar

Field Summary
 HttpContent content
          HTTP content or null for none.
 com.google.common.collect.ListMultimap<String,String> headers
          Headers added in addHeader(String, String).
 String url
          Request URL or null for none.
 
Constructor Summary
MockLowLevelHttpRequest()
           
MockLowLevelHttpRequest(String url)
           
 
Method Summary
 void addHeader(String name, String value)
          Adds a header to the HTTP request.
 LowLevelHttpResponse execute()
          Executes the request and returns a low-level HTTP response object.
 void setContent(HttpContent content)
          Sets the HTTP request content.
 
Methods inherited from class com.google.api.client.http.LowLevelHttpRequest
setTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

url

public String url
Request URL or null for none.

Since:
1.4

headers

public final com.google.common.collect.ListMultimap<String,String> headers
Headers added in addHeader(String, String).

Since:
1.4

content

public HttpContent content
HTTP content or null for none.

Since:
1.4
Constructor Detail

MockLowLevelHttpRequest

public MockLowLevelHttpRequest()

MockLowLevelHttpRequest

public MockLowLevelHttpRequest(String url)
Parameters:
url - Request URL or null for none
Since:
1.4
Method Detail

addHeader

public void addHeader(String name,
                      String value)
Description copied from class: LowLevelHttpRequest
Adds a header to the HTTP request.

Note that multiple headers of the same name need to be supported, in which case LowLevelHttpRequest.addHeader(java.lang.String, java.lang.String) will be called for each instance of the header.

Specified by:
addHeader in class LowLevelHttpRequest
Parameters:
name - header name
value - header value

execute

public LowLevelHttpResponse execute()
                             throws IOException
Description copied from class: LowLevelHttpRequest
Executes the request and returns a low-level HTTP response object.

Specified by:
execute in class LowLevelHttpRequest
Throws:
IOException

setContent

public void setContent(HttpContent content)
                throws IOException
Description copied from class: LowLevelHttpRequest
Sets the HTTP request content.

Specified by:
setContent in class LowLevelHttpRequest
Throws:
IOException - I/O exception


Copyright © 2010-2011 Google. All Rights Reserved.