@Test
public void shouldReturnEnvelope() throws Exception {

    when(textMessage.getText()).thenReturn(MESSAGE_TEXT);
    when(stringToJsonObjectConverter.convert(MESSAGE_TEXT)).thenReturn(messageAsJsonObject);
    when(jsonObjectEnvelopeConverter.asEnvelope(messageAsJsonObject)).thenReturn(envelope);
    JsonEnvelope actualEnvelope = envelopeConverter.fromMessage(textMessage);
    assertThat(actualEnvelope, equalTo(envelope));
}