@SuppressWarnings("unchecked")
@Test
public void shouldReturnErrorMessageOnError() throws JMSException {

    when(message.getText()).thenThrow(JMSException.class);
    assertThat(jmsMessageLoggerHelper.toJmsTraceString(message), containsString("Could not find: _metadata in message"));
}