### Question:
InMemoryMessagePublisher implements MessagePublisher<T>, Resettable { @Override public void publish(final T message) throws MessagePublishException { publishedMessages.add(message); logger.debug("Published message; message:[" + message + "] exchange:[" + exchange.getName() + "]"); if (forwardMessagesToExchange) { exchange.route(message); } } InMemoryMessagePublisher(final Exchange<T> exchange); @Override void publish(final T message); void setForwardMessagesToExchange(final boolean forwardMessagesToExchange); List<T> getPublishedMessages(); @Override String toString(); @Override void reset();  }### Answer:
@Test public void shouldNotForwardMessageToExchange_afterConstruction() { final TypedMessage mockTypedMessage = mock(TypedMessage.class); inMemoryMessagePublisher.publish(mockTypedMessage); verify(mockExchange, never()).route(any(TypedMessage.class)); }