@Test
public void testCreateSessionFails() throws JMSException {

    new TestKit(actorSystem) {{
        when(mockConnection.createSession(anyInt())).thenThrow(JMS_EXCEPTION);
        final Props props =
                AmqpClientActor.propsForTests(connection, getRef(),
                        getRef(), (ac, el) -> mockConnection);
        final ActorRef amqpClientActor = actorSystem.actorOf(props);
        amqpClientActor.tell(OpenConnection.of(CONNECTION_ID, DittoHeaders.empty()), getRef());
        expectMsg(new Status.Failure(SESSION_EXCEPTION));
    }};
}