Class MockIncoming<P>

java.lang.Object
io.helidon.messaging.connectors.mock.MockIncoming<P>
Type Parameters:
P - type of the payload

public class MockIncoming<P> extends Object
Mock-able incoming channel connected to the mock connector.
  • Method Details

    • emit

      @SafeVarargs public final MockIncoming<P> emit(P... payload)
      Emit one or more payloads directly to the mocked channel.
      Parameters:
      payload - one or more payloads to send down the stream
      Returns:
      this channel mocker
    • emit

      @SafeVarargs public final MockIncoming<P> emit(Message<P>... message)
      Emit one or more messages directly to the mocked channel.
      Parameters:
      message - one or more messages to send down the stream
      Returns:
      this channel mocker
    • complete

      public MockIncoming<P> complete()
      Send terminal complete signal to the channel.
      Returns:
      this channel mocker
    • fail

      public MockIncoming<P> fail(Throwable t)
      Send terminal error signal to the channel.
      Parameters:
      t - cause of the channel termination
      Returns:
      this channel mocker
    • awaitCancelled

      public MockIncoming<P> awaitCancelled(Duration timeout)
      Wait and block till the stream is in terminal state and asserts if the terminal state is caused by cancel signal.
      Parameters:
      timeout - Timeout for waiting on the stream being cancelled.
      Returns:
      this mock