HiveMqtt5ClientActor extends AbstractMqttClientActor<Mqtt5Subscribe, Mqtt5Publish, Mqtt5AsyncClient, Mqtt5SubAck> { public static Props props(final Connection connection, final ActorRef proxyActor, final HiveMqtt5ClientFactory clientFactory, final ActorRef connectionActor) { return Props.create(HiveMqtt5ClientActor.class, connection, proxyActor, connectionActor, clientFactory); } @SuppressWarnings("unused") // used by `props` via reflection private  HiveMqtt5ClientActor(final Connection connection,
            final ActorRef proxyActor,
            final ActorRef connectionActor,
            final HiveMqtt5ClientFactory clientFactory); @SuppressWarnings("unused") // used by `props` via reflection private  HiveMqtt5ClientActor(final Connection connection, final ActorRef proxyActor,
            final ActorRef connectionActor); static Props props(final Connection connection, final ActorRef proxyActor,
            final HiveMqtt5ClientFactory clientFactory, final ActorRef connectionActor); static Props props(final Connection connection, @Nullable final ActorRef proxyActor,
            final ActorRef connectionActor);  }
@Test public void testSubscribeFails() { new TestKit(actorSystem) {{ final MockHiveMqtt5ClientFactory clientFactory = mockHiveMqtt5ClientFactory .withTestProbe(getRef()) .withFailingSubscribe(); final Props props = HiveMqtt5ClientActor.props(connection, getRef(), clientFactory, mockConnectionActor.ref()); 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); }}; }