Class HttpResponse
java.lang.Object
de.gematik.test.tiger.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
de.gematik.test.tiger.mockserver.model.ObjectWithJsonToString
de.gematik.test.tiger.mockserver.model.HttpMessage<HttpResponse>
de.gematik.test.tiger.mockserver.model.HttpResponse
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.gematik.test.tiger.mockserver.model.Action
Action.Direction, Action.Type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleancontainsHeader(String name, String value) Returns true if a header with the specified name has been addedbooleangetFirstHeader(String name) intgetType()inthashCode()static HttpResponseStatic builder to create a not found response.removeHeader(String name) replaceHeader(Header header) Update header to return as a Header object, if a header with the same name already exists it will be modifiedstatic HttpResponseresponse()Static builder to create a response.voidsetExpectationId(String expectationId) voidsetHashCode(int hashCode) voidsetHeaders(Headers headers) voidsetReasonPhrase(String reasonPhrase) voidsetStatusCode(Integer statusCode) voidsetStreamId(Integer streamId) toString()withBody(byte[] body) withHeader(Header header) Add a header to return as a Header object, if a header with the same name already exists this will NOT be modified but two headers will existwithHeader(String name, String... values) Add a header to return as a Header object, if a header with the same name already exists this will NOT be modified but two headers will existwithHeaders(Headers headers) withReasonPhrase(String reasonPhrase) The reason phrase to return, if no reason code is returned this will be defaulted to the standard reason phrase for the statusCode, i.e. for a statusCode of 200 the standard reason phrase is "OK"withStatusCode(Integer statusCode) The status code to return, such as 200, 404, the status code specified here will result in the default status message for this status code for example for 200 the status message "OK" is usedwithStreamId(Integer streamId) voidwrite(NettyResponseWriter nettyResponseWriter, HttpRequest request) Methods inherited from class de.gematik.test.tiger.mockserver.model.HttpMessage
getBody, getParsedMessageFuture, setBody, setParsedMessageFutureMethods inherited from class de.gematik.test.tiger.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
fieldsExcludedFromEqualsAndHashCode
-
Constructor Details
-
HttpResponse
public HttpResponse()
-
-
Method Details
-
response
Static builder to create a response. -
notFoundResponse
Static builder to create a not found response. -
withStatusCode
The status code to return, such as 200, 404, the status code specified here will result in the default status message for this status code for example for 200 the status message "OK" is used- Parameters:
statusCode- an integer such as 200 or 404
-
withReasonPhrase
The reason phrase to return, if no reason code is returned this will be defaulted to the standard reason phrase for the statusCode, i.e. for a statusCode of 200 the standard reason phrase is "OK"- Parameters:
reasonPhrase- an string such as "Not Found" or "OK"
-
withBody
- Specified by:
withBodyin classHttpMessage<HttpResponse>
-
withHeaders
- Specified by:
withHeadersin classHttpMessage<HttpResponse>
-
withHeader
Add a header to return as a Header object, if a header with the same name already exists this will NOT be modified but two headers will exist- Specified by:
withHeaderin classHttpMessage<HttpResponse>- Parameters:
header- a Header object
-
withHeader
Add a header to return as a Header object, if a header with the same name already exists this will NOT be modified but two headers will exist- Specified by:
withHeaderin classHttpMessage<HttpResponse>- Parameters:
name- the header namevalues- the header values
-
replaceHeader
Update header to return as a Header object, if a header with the same name already exists it will be modified- Specified by:
replaceHeaderin classHttpMessage<HttpResponse>- Parameters:
header- a Header object
-
getHeaderList
- Specified by:
getHeaderListin classHttpMessage<HttpResponse>
-
getHeader
- Specified by:
getHeaderin classHttpMessage<HttpResponse>
-
getFirstHeader
- Specified by:
getFirstHeaderin classHttpMessage<HttpResponse>
-
removeHeader
- Specified by:
removeHeaderin classHttpMessage<HttpResponse>
-
containsHeader
Returns true if a header with the specified name has been added- Parameters:
name- the header namevalue- the header value- Returns:
- true if a header has been added with that name otherwise false
-
withStreamId
-
getType
-
write
-
getHeaderMultimap
-
equals
- Overrides:
equalsin classHttpMessage<HttpResponse>
-
canEqual
- Overrides:
canEqualin classHttpMessage<HttpResponse>
-
hashCode
public int hashCode()- Overrides:
hashCodein classHttpMessage<HttpResponse>
-
getHashCode
public int getHashCode() -
getStatusCode
-
getReasonPhrase
-
getHeaders
- Specified by:
getHeadersin classHttpMessage<HttpResponse>
-
getStreamId
-
getExpectationId
- Specified by:
getExpectationIdin interfaceAction
-
setHashCode
public void setHashCode(int hashCode) -
setStatusCode
-
setReasonPhrase
-
setHeaders
-
setStreamId
-
setExpectationId
-
toString
- Overrides:
toStringin classHttpMessage<HttpResponse>
-