Class StreamFrameDecision

java.lang.Object
org.mockserver.mock.breakpoint.StreamFrameDecision

public class StreamFrameDecision extends Object
The resolution decision for a paused (breakpointed) streaming response frame.

Five actions are supported:

  • Method Details

    • continueFrame

      public static StreamFrameDecision continueFrame()
      Continue: write the original frame unchanged.
    • modify

      public static StreamFrameDecision modify(byte[] replacementBody)
      Modify: write a replacement frame body instead of the original.
      Parameters:
      replacementBody - the replacement bytes (must not be null)
    • drop

      public static StreamFrameDecision drop()
      Drop: discard the frame without writing anything to the client.
    • inject

      public static StreamFrameDecision inject(byte[] injectedBody)
      Inject: write the original frame, then also write an additional injected frame.
      Parameters:
      injectedBody - the extra frame body to inject after the original
    • close

      public static StreamFrameDecision close()
      Close: end the stream (drop the held frame, send LastHttpContent, close the connection).
    • getAction

      public StreamFrameDecision.Action getAction()
    • getReplacementBody

      public byte[] getReplacementBody()
      The replacement body (non-null only for StreamFrameDecision.Action.MODIFY).
    • getInjectedBody

      public byte[] getInjectedBody()
      The injected body (non-null only for StreamFrameDecision.Action.INJECT).