@Test public void testStreamMessage_validateRoutingPlanHeaderWhenNoRoutingPlanProvided() { final MessageRoutingPlan routingPlan = null; Mockito.when(resourceProvider.getServiceRegistryApi()).thenReturn(serviceRegistryApi); Mockito.when(resourceProvider.getQueueConfigurationClass()).thenReturn(QueueConfiguration.class); Mockito .when(serviceRegistryApi.getQueueConfiguration(eq(QueueConfiguration.class), anyString(), eq(context))) .thenReturn(mock(QueueConfiguration.class)); MessageWriter messageWriter = mock(MessageWriter.class); String messageGroup = "message-group"; Map<String, String> messageHeaders = mock(Map.class); Map<String, String> messageContext = mock(Map.class); messageSender.streamMessage(messageWriter, messageHeaders, messageContext, routingPlan, messageGroup); ArgumentCaptor<Map> actualMessageHeadersCaptor = ArgumentCaptor.forClass(Map.class); Mockito .verify(runtimeMessageSender) .streamMessage(eq(messageWriter), actualMessageHeadersCaptor.capture(), eq(messageGroup)); Map<String, String> actualMessageHeaders = actualMessageHeadersCaptor.getValue(); assertTrue("Expected empty message headers", actualMessageHeaders.size() == 0); }
@Override public void streamMessage(MessageWriter messageWriter, Map<String, String> messageHeaders) { streamMessage(messageWriter, messageHeaders, null, null, null); }
MessageSenderImpl implements MessageSender { @Override public void streamMessage(MessageWriter messageWriter, Map<String, String> messageHeaders) { streamMessage(messageWriter, messageHeaders, null, null, null); } }
MessageSenderImpl implements MessageSender { @Override public void streamMessage(MessageWriter messageWriter, Map<String, String> messageHeaders) { streamMessage(messageWriter, messageHeaders, null, null, null); } MessageSenderImpl(
            RuntimeMessageSender runtimeMessageSender,
            SerializationManager serializationManager,
            ResourceProvider resourceProvider,
            Context context); }
MessageSenderImpl implements MessageSender { @Override public void streamMessage(MessageWriter messageWriter, Map<String, String> messageHeaders) { streamMessage(messageWriter, messageHeaders, null, null, null); } MessageSenderImpl(
            RuntimeMessageSender runtimeMessageSender,
            SerializationManager serializationManager,
            ResourceProvider resourceProvider,
            Context context); @Override void streamMessage(MessageWriter messageWriter, Map<String, String> messageHeaders); @Override void streamMessage(MessageWriter messageWriter, Map<String, String> messageHeaders, String messageGroup); @Override void streamMessage(
            MessageWriter messageWriter,
            Map<String, String> messageHeaders,
            Map<String, String> messageContext); @Override void streamMessage(
            MessageWriter messageWriter,
            Map<String, String> messageHeaders,
            Map<String, String> messageContext,
            String messageGroup); @Override void streamMessage(
            MessageWriter messageWriter,
            Map<String, String> messageHeaders,
            Map<String, String> messageContext,
            MessageRoutingPlan messageRoutingPlan); @Override void streamMessage(
            MessageWriter messageWriter,
            Map<String, String> messageHeaders,
            Map<String, String> messageContext,
            MessageRoutingPlan messageRoutingPlan,
            String messageGroup); @Override void sendMessage(Class<T> format, T objectForSerialization, Map<String, String> messageHeaders); @Override void sendMessage(
            Class<T> format,
            T objectForSerialization,
            Map<String, String> messageHeaders,
            String messageGroup); @Override void sendMessage(
            Class<T> format,
            T objectForSerialization,
            Map<String, String> messageHeaders,
            Map<String, String> messageContext); @Override void sendMessage(
            Class<T> format,
            T objectForSerialization,
            Map<String, String> messageHeaders,
            Map<String, String> messageContext,
            String messageGroup); @Override void sendMessage(
            Class<T> format,
            final T objectForSerialization,
            Map<String, String> messageHeaders,
            Map<String, String> messageContext,
            MessageRoutingPlan messageRoutingPlan); @Override void sendMessage(
            Class<T> format,
            final T objectForSerialization,
            Map<String, String> messageHeaders,
            Map<String, String> messageContext,
            MessageRoutingPlan messageRoutingPlan,
            String messageGroup); }
MessageSenderImpl implements MessageSender { @Override public void streamMessage(MessageWriter messageWriter, Map<String, String> messageHeaders) { streamMessage(messageWriter, messageHeaders, null, null, null); } MessageSenderImpl(
            RuntimeMessageSender runtimeMessageSender,
            SerializationManager serializationManager,
            ResourceProvider resourceProvider,
            Context context); @Override void streamMessage(MessageWriter messageWriter, Map<String, String> messageHeaders); @Override void streamMessage(MessageWriter messageWriter, Map<String, String> messageHeaders, String messageGroup); @Override void streamMessage(
            MessageWriter messageWriter,
            Map<String, String> messageHeaders,
            Map<String, String> messageContext); @Override void streamMessage(
            MessageWriter messageWriter,
            Map<String, String> messageHeaders,
            Map<String, String> messageContext,
            String messageGroup); @Override void streamMessage(
            MessageWriter messageWriter,
            Map<String, String> messageHeaders,
            Map<String, String> messageContext,
            MessageRoutingPlan messageRoutingPlan); @Override void streamMessage(
            MessageWriter messageWriter,
            Map<String, String> messageHeaders,
            Map<String, String> messageContext,
            MessageRoutingPlan messageRoutingPlan,
            String messageGroup); @Override void sendMessage(Class<T> format, T objectForSerialization, Map<String, String> messageHeaders); @Override void sendMessage(
            Class<T> format,
            T objectForSerialization,
            Map<String, String> messageHeaders,
            String messageGroup); @Override void sendMessage(
            Class<T> format,
            T objectForSerialization,
            Map<String, String> messageHeaders,
            Map<String, String> messageContext); @Override void sendMessage(
            Class<T> format,
            T objectForSerialization,
            Map<String, String> messageHeaders,
            Map<String, String> messageContext,
            String messageGroup); @Override void sendMessage(
            Class<T> format,
            final T objectForSerialization,
            Map<String, String> messageHeaders,
            Map<String, String> messageContext,
            MessageRoutingPlan messageRoutingPlan); @Override void sendMessage(
            Class<T> format,
            final T objectForSerialization,
            Map<String, String> messageHeaders,
            Map<String, String> messageContext,
            MessageRoutingPlan messageRoutingPlan,
            String messageGroup);  }