HiveMqtt3ClientActor extends AbstractMqttClientActor<Mqtt3Subscribe, Mqtt3Publish, Mqtt3AsyncClient, Mqtt3SubAck> { public static Props props(final Connection connection, @Nullable final ActorRef proxyActor, final ActorRef connectionActor, final HiveMqtt3ClientFactory clientFactory) { return Props.create(HiveMqtt3ClientActor.class, connection, proxyActor, connectionActor, clientFactory); } @SuppressWarnings("unused") // used by `props` via reflection private  HiveMqtt3ClientActor(final Connection connection,
            @Nullable final ActorRef proxyActor,
            final ActorRef connectionActor,
            final HiveMqtt3ClientFactory clientFactory); @SuppressWarnings("unused") // used by `props` via reflection private  HiveMqtt3ClientActor(final Connection connection, @Nullable final ActorRef proxyActor,
            final ActorRef connectionActor); static Props props(final Connection connection, @Nullable final ActorRef proxyActor,
            final ActorRef connectionActor, final HiveMqtt3ClientFactory clientFactory); static Props props(final Connection connection, @Nullable final ActorRef proxyActor,
            final ActorRef connectionActor);  }
@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); }}; }