com.atlassian.sal.testresources.net
Class MockRequestFactory
java.lang.Object
com.atlassian.sal.testresources.net.MockRequestFactory
- All Implemented Interfaces:
- RequestFactory<Request<?,?>>
public class MockRequestFactory
- extends Object
- implements RequestFactory<Request<?,?>>
Mock request factory. Either mock a request and call addRequest() with the URL you want that request
returned for, or the factory, if no request has been set for that URL, will create a MockRequest for you.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MockRequestFactory
public MockRequestFactory()
addRequest
public void addRequest(String url,
Request<?,?> request)
createRequest
public Request<?,?> createRequest(Request.MethodType methodType,
String url)
- Description copied from interface:
RequestFactory
- Creates a request of given
Request.MethodType to given url
- Specified by:
createRequest in interface RequestFactory<Request<?,?>>
- Parameters:
methodType - The HTTP method typeurl - The url to request
- Returns:
- The request object
supportsHeader
public boolean supportsHeader()
- Description copied from interface:
RequestFactory
- Indicates whether the requests can support headers
- Specified by:
supportsHeader in interface RequestFactory<Request<?,?>>
- Returns:
- true if the requests can support headers
- See Also:
Request.setHeader(String, String),
Request.addHeader(String, String)
Copyright © 2011 Atlassian. All Rights Reserved.