VertxMessageConverter implements MessageConverter<io.vertx.core.eventbus.Message, io.vertx.core.eventbus.Message, VertxEndpointConfiguration> { @Override public Message convertInbound(io.vertx.core.eventbus.Message vertxMessage, VertxEndpointConfiguration endpointConfiguration, TestContext context) { if (vertxMessage == null) { return null; } Message message = new DefaultMessage(vertxMessage.body()) .setHeader(CitrusVertxMessageHeaders.VERTX_ADDRESS, vertxMessage.address()) .setHeader(CitrusVertxMessageHeaders.VERTX_REPLY_ADDRESS, vertxMessage.replyAddress()); return message; }  @Override Message convertInbound(io.vertx.core.eventbus.Message vertxMessage, VertxEndpointConfiguration endpointConfiguration, TestContext context); @Override io.vertx.core.eventbus.Message convertOutbound(Message internalMessage, VertxEndpointConfiguration endpointConfiguration, TestContext context); @Override void convertOutbound(io.vertx.core.eventbus.Message externalMessage, Message internalMessage, VertxEndpointConfiguration endpointConfiguration, TestContext context);  }
@Test public void testConvertInbound() { reset(vertxMessage); when(vertxMessage.body()).thenReturn("Hello Citrus!"); when(vertxMessage.address()).thenReturn("hello"); when(vertxMessage.replyAddress()).thenReturn("answer"); Message message = messageConverter.convertInbound(vertxMessage, new VertxEndpointConfiguration(), context); Assert.assertEquals(message.getPayload(), "Hello Citrus!"); Assert.assertEquals(message.getHeader(CitrusVertxMessageHeaders.VERTX_ADDRESS), "hello"); Assert.assertEquals(message.getHeader(CitrusVertxMessageHeaders.VERTX_REPLY_ADDRESS), "answer"); }
@Test public void testConvertInboundNullMessage() { Assert.assertNull(messageConverter.convertInbound(null, new VertxEndpointConfiguration(), context)); }