VertxSyncEndpoint extends VertxEndpoint { @Override public Producer createProducer() { if (vertxSyncMessageConsumer != null) { return vertxSyncMessageConsumer; } if (vertxSyncMessageProducer == null) { vertxSyncMessageProducer = new VertxSyncProducer(getProducerName(), getVertxInstanceFactory().newInstance(getEndpointConfiguration()), getEndpointConfiguration()); } return vertxSyncMessageProducer; } VertxSyncEndpoint();  VertxSyncEndpoint(VertxSyncEndpointConfiguration endpointConfiguration); @Override VertxSyncEndpointConfiguration getEndpointConfiguration(); @Override Consumer createConsumer(); @Override Producer createProducer();  }
@Test public void testVertxSyncEndpointWithOutboundMessageListeners() { String eventBusAddress = "news-feed"; VertxSyncEndpointConfiguration endpointConfiguration = new VertxSyncEndpointConfiguration(); endpointConfiguration.setAddress(eventBusAddress); VertxSyncEndpoint vertxEndpoint = new VertxSyncEndpoint(endpointConfiguration); vertxEndpoint.setVertxInstanceFactory(instanceFactory); Message requestMessage = new DefaultMessage("Hello from Citrus!"); context.setMessageListeners(messageListeners); reset(vertx, eventBus, messageListeners); when(vertx.eventBus()).thenReturn(eventBus); when(eventBus.send(eq(eventBusAddress), eq(requestMessage.getPayload()), any(Handler.class))).thenReturn(eventBus); when(messageListeners.isEmpty()).thenReturn(false); vertxEndpoint.createProducer().send(requestMessage, context); verify(messageListeners).onOutboundMessage(requestMessage, context); }