Class MessageMock

java.lang.Object
com.codingchili.core.testing.MessageMock
All Implemented Interfaces:
io.vertx.core.eventbus.Message<Object>

public class MessageMock extends Object implements io.vertx.core.eventbus.Message<Object>
Mock class for messages.
  • Constructor Details

    • MessageMock

      public MessageMock(io.vertx.core.json.JsonObject json)
      Creates a new message mock.
      Parameters:
      json - the payload of the message.
  • Method Details

    • setListener

      public MessageMock setListener(ResponseListener listener)
    • body

      public Object body()
      Specified by:
      body in interface io.vertx.core.eventbus.Message<Object>
    • reply

      public void reply(Object message)
      Specified by:
      reply in interface io.vertx.core.eventbus.Message<Object>
    • address

      public String address()
      Specified by:
      address in interface io.vertx.core.eventbus.Message<Object>
    • headers

      public io.vertx.core.MultiMap headers()
      Specified by:
      headers in interface io.vertx.core.eventbus.Message<Object>
    • replyAddress

      public String replyAddress()
      Specified by:
      replyAddress in interface io.vertx.core.eventbus.Message<Object>
    • isSend

      public boolean isSend()
      Specified by:
      isSend in interface io.vertx.core.eventbus.Message<Object>
    • reply

      public void reply(Object message, io.vertx.core.eventbus.DeliveryOptions options)
      Specified by:
      reply in interface io.vertx.core.eventbus.Message<Object>
    • fail

      public void fail(int failureCode, String message)
      Specified by:
      fail in interface io.vertx.core.eventbus.Message<Object>
    • replyAndRequest

      public <R> void replyAndRequest(Object message, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.eventbus.Message<R>>> replyHandler)
      Specified by:
      replyAndRequest in interface io.vertx.core.eventbus.Message<Object>
    • replyAndRequest

      public <R> io.vertx.core.Future<io.vertx.core.eventbus.Message<R>> replyAndRequest(Object message)
      Specified by:
      replyAndRequest in interface io.vertx.core.eventbus.Message<Object>
    • replyAndRequest

      public <R> void replyAndRequest(Object message, io.vertx.core.eventbus.DeliveryOptions options, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.eventbus.Message<R>>> replyHandler)
      Specified by:
      replyAndRequest in interface io.vertx.core.eventbus.Message<Object>
    • replyAndRequest

      public <R> io.vertx.core.Future<io.vertx.core.eventbus.Message<R>> replyAndRequest(Object message, io.vertx.core.eventbus.DeliveryOptions options)
      Specified by:
      replyAndRequest in interface io.vertx.core.eventbus.Message<Object>