@Test
public void testSubscribeFails() {

    new TestKit(actorSystem) {{
        final MockHiveMqtt3ClientFactory clientFactory = mockHiveMqtt3ClientFactory
                .withTestProbe(getRef())
                .withFailingSubscribe();
        final Props props = HiveMqtt3ClientActor.props(connection, getRef(), getRef(), clientFactory);
        final ActorRef mqttClientActor = actorSystem.actorOf(props, "mqttClientActor-testSubscribeFails");
        mqttClientActor.tell(OpenConnection.of(connectionId, DittoHeaders.empty()), getRef());
        expectMsgClass(Status.Failure.class);
        mqttClientActor.tell(CloseConnection.of(connectionId, DittoHeaders.empty()), getRef());
        expectMsg(DISCONNECTED_SUCCESS);
    }};
}