|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.kristofa.test.http.AbstractHttpResponseProvider
com.github.kristofa.test.http.file.FileHttpResponseProvider
public class FileHttpResponseProvider
HttpResponseProvider that is able to serve responses for requests/responses previously saved by
HttpRequestResponseFileLogger.
It supports submitting same request multiple times with different return result.
It reads all http requests on construction and keeps them in memory. It does not keep responses in memory. They are read from disk on request and not cached.
HttpRequestResponseFileLogger,
LoggingHttpProxy| Constructor Summary | |
|---|---|
FileHttpResponseProvider(String directory,
String fileName)
Creates a new instance. |
|
FileHttpResponseProvider(String directory,
String fileName,
com.github.kristofa.test.http.file.HttpRequestFileReader requestFileReader,
HttpResponseFileReader responseFileReader)
Creates a new instance. |
|
| Method Summary | |
|---|---|
protected void |
lazyInitializeExpectedRequestsAndResponses()
Override this method if you want to lazily initialize requests/responses. |
| Methods inherited from class com.github.kristofa.test.http.AbstractHttpResponseProvider |
|---|
addExpected, addHttpRequestMatchingFilter, getResponse, resetState, verify |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileHttpResponseProvider(String directory,
String fileName)
directory - Directory from which to read files.fileName - Base file name. Should not contain extension. Will be suffixed with sequence number and .txt
extension. Should be same as used in HttpRequestResponseFileLogger.
public FileHttpResponseProvider(String directory,
String fileName,
com.github.kristofa.test.http.file.HttpRequestFileReader requestFileReader,
HttpResponseFileReader responseFileReader)
directory - Directory from which to read files.fileName - Base file name. Should not contain extension. Will be suffixed with sequence number and .txt
extension. Should be same as used in HttpRequestResponseFileLogger.requestFileReader - HTTP request file reader.responseFileReader - HTTP response file reader.| Method Detail |
|---|
protected void lazyInitializeExpectedRequestsAndResponses()
AbstractHttpResponseProvider.getResponse(HttpRequest).
You can initialize expected requests and responses by calling
AbstractHttpResponseProvider.addExpected(HttpRequest, HttpResponseProxy).
lazyInitializeExpectedRequestsAndResponses in class AbstractHttpResponseProvider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||