Package org.mockserver.mock.breakpoint
Class StreamFrameDecision
java.lang.Object
org.mockserver.mock.breakpoint.StreamFrameDecision
The resolution decision for a paused (breakpointed) streaming response frame.
Five actions are supported:
StreamFrameDecision.Action.CONTINUE— write the original frame as-isStreamFrameDecision.Action.MODIFY— write a replacement frame bodyStreamFrameDecision.Action.DROP— discard the frame (do not write to client)StreamFrameDecision.Action.INJECT— write the original frame AND an additional injected frameStreamFrameDecision.Action.CLOSE— end the stream (send LastHttpContent, close connection)
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic StreamFrameDecisionclose()Close: end the stream (drop the held frame, send LastHttpContent, close the connection).static StreamFrameDecisionContinue: write the original frame unchanged.static StreamFrameDecisiondrop()Drop: discard the frame without writing anything to the client.byte[]The injected body (non-null only forStreamFrameDecision.Action.INJECT).byte[]The replacement body (non-null only forStreamFrameDecision.Action.MODIFY).static StreamFrameDecisioninject(byte[] injectedBody) Inject: write the original frame, then also write an additional injected frame.static StreamFrameDecisionmodify(byte[] replacementBody) Modify: write a replacement frame body instead of the original.
-
Method Details
-
continueFrame
Continue: write the original frame unchanged. -
modify
Modify: write a replacement frame body instead of the original.- Parameters:
replacementBody- the replacement bytes (must not be null)
-
drop
Drop: discard the frame without writing anything to the client. -
inject
Inject: write the original frame, then also write an additional injected frame.- Parameters:
injectedBody- the extra frame body to inject after the original
-
close
Close: end the stream (drop the held frame, send LastHttpContent, close the connection). -
getAction
-
getReplacementBody
public byte[] getReplacementBody()The replacement body (non-null only forStreamFrameDecision.Action.MODIFY). -
getInjectedBody
public byte[] getInjectedBody()The injected body (non-null only forStreamFrameDecision.Action.INJECT).
-