@Test
public void handleFailureOnJmsConnect() throws JMSException {

    new TestKit(actorSystem) {{
        final IllegalStateException exception = new IllegalStateException("failureOnJmsConnect");
        doThrow(exception).when(mockConnection).start();
        final Props props = JMSConnectionHandlingActor.props(connection, e -> {}, jmsConnectionFactory);
        final ActorRef connectionHandlingActor = watch(actorSystem.actorOf(props));
        final TestProbe origin = TestProbe.apply(actorSystem);
        connectionHandlingActor.tell(new AmqpClientActor.JmsConnect(origin.ref()), getRef());
        final ConnectionFailure connectionFailure1 = expectMsgClass(ConnectionFailure.class);
        assertThat(connectionFailure1.getOrigin()).contains(origin.ref());
        assertThat(connectionFailure1.getFailure().cause()).isSameAs(exception);
    }};
}