Package org.mockserver.model
Class HttpSseResponse
java.lang.Object
-
Nested Class Summary
Nested classes/interfaces inherited from class org.mockserver.model.Action
Action.Direction, Action.Type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetType()inthashCode()static HttpSseResponsewithCloseConnection(Boolean closeConnection) withEvents(List<SseEvent> events) withEvents(SseEvent... events) withHeader(String name, String... values) withHeader(Header header) withHeaders(Headers headers) withStatusCode(Integer statusCode) withTemplateType(HttpTemplate.TemplateType templateType) Opt-in response templating: when set (toHttpTemplate.TemplateType.VELOCITY,HttpTemplate.TemplateType.MUSTACHEorHttpTemplate.TemplateType.JAVASCRIPT), each event'sdatapayload is rendered as a response template against the triggering request (so$!request.body,$jsonPath(...), the built-in helpers, thefakerhelper and thescenariohelper are all available) rather than emitted verbatim.Methods inherited from class org.mockserver.model.Action
getDelay, getExpectationId, isPrimary, setExpectationId, withDelay, withDelay, withPrimaryMethods inherited from class org.mockserver.model.ObjectWithJsonToString
toStringMethods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
fieldsExcludedFromEqualsAndHashCode
-
Constructor Details
-
HttpSseResponse
public HttpSseResponse()
-
-
Method Details
-
sseResponse
-
withStatusCode
-
getStatusCode
-
withHeaders
-
withHeader
-
withHeader
-
getHeaders
-
withEvents
-
withEvents
-
withEvent
-
getEvents
-
withCloseConnection
-
getCloseConnection
-
withTemplateType
Opt-in response templating: when set (toHttpTemplate.TemplateType.VELOCITY,HttpTemplate.TemplateType.MUSTACHEorHttpTemplate.TemplateType.JAVASCRIPT), each event'sdatapayload is rendered as a response template against the triggering request (so$!request.body,$jsonPath(...), the built-in helpers, thefakerhelper and thescenariohelper are all available) rather than emitted verbatim. The template is rendered once per event, immediately before the event is written.When
null(the default) every event is emitted byte-for-byte unchanged, exactly as before this field existed. -
getTemplateType
-
getType
- Specified by:
getTypein classAction<HttpSseResponse>
-
equals
- Overrides:
equalsin classAction<HttpSseResponse>
-
hashCode
public int hashCode()- Overrides:
hashCodein classAction<HttpSseResponse>
-