### Question:
Producer { public void send(String body) { if (isStopped) { throw new IllegalStateException(String.format( "Producer %s was stopped and fail to deliver requested message [%s].", body, name)); } var msg = new SimpleMessage(); msg.addHeader(Headers.DATE, new Date().toString()); msg.addHeader(Headers.SENDER, name); msg.setBody(body); try { queue.put(msg); } catch (InterruptedException e) { LOGGER.error("Exception caught.", e); } } Producer(String name, MqPublishPoint queue); void send(String body); void stop();  }### Answer:
@Test public void testSend() throws Exception { final var publishPoint = mock(MqPublishPoint.class); final var producer = new Producer("producer", publishPoint); verifyZeroInteractions(publishPoint); producer.send("Hello!"); final var messageCaptor = ArgumentCaptor.forClass(Message.class); verify(publishPoint).put(messageCaptor.capture()); final var message = messageCaptor.getValue(); assertNotNull(message); assertEquals("producer", message.getHeader(Message.Headers.SENDER)); assertNotNull(message.getHeader(Message.Headers.DATE)); assertEquals("Hello!", message.getBody()); verifyNoMoreInteractions(publishPoint); }