@Test
public void shouldSendJsonEnvelopeToJmsQueue() throws Exception {

    final String destinationName = "destination name";
    final Connection connection = mock(Connection.class);
    final Session session = mock(Session.class);
    final MessageProducer messageProducer = mock(MessageProducer.class);
    final Destination destination = mock(Destination.class);
    final JsonEnvelope jsonEnvelope = mock(JsonEnvelope.class);
    final TextMessage textMessage = mock(TextMessage.class);
    when(destinationProvider.getDestination(destinationName)).thenReturn(destination);
    when(connectionFactory.createConnection()).thenReturn(connection);
    when(connection.createSession(false, AUTO_ACKNOWLEDGE)).thenReturn(session);
    when(session.createProducer(destination)).thenReturn(messageProducer);
    when(envelopeConverter.toMessage(jsonEnvelope, session)).thenReturn(textMessage);
    jmsSender.send(jsonEnvelope, destinationName);
    verify(messageProducer).send(textMessage);
}