@Test
public void shouldThrowExceptionIfInitialContextThrowsNamingException() throws Exception {

    final NamingException namingException = new NamingException("Ooops");
    final String destinationName = "destination name";
    when(initialContext.lookup(destinationName)).thenThrow(namingException);
    try {
        destinationProvider.getDestination(destinationName);
        fail();
    } catch (final JmsEnvelopeSenderException expected) {
        assertThat(expected.getCause(), is(namingException));
        assertThat(expected.getMessage(), is("Exception while looking up JMS destination name 'destination name'"));
    }
}