@Test public void connectWithCleanSessionUpdateClientSession() { MqttConnectMessage msg = connMsg.clientId(FAKE_CLIENT_ID).cleanSession(true).build(); connection.processConnect(msg); assertEqualsConnAck(CONNECTION_ACCEPTED, channel.readOutbound()); connection.processDisconnect(null); assertFalse(channel.isOpen()); EmbeddedChannel anotherChannel = new EmbeddedChannel(); MQTTConnection anotherConnection = createMQTTConnection(ALLOW_ANONYMOUS_AND_ZEROBYTE_CLIENT_ID, anotherChannel); MqttConnectMessage secondConnMsg = MqttMessageBuilders.connect() .clientId(FAKE_CLIENT_ID) .protocolVersion(MqttVersion.MQTT_3_1) .build(); anotherConnection.processConnect(secondConnMsg); assertEqualsConnAck(CONNECTION_ACCEPTED, anotherChannel.readOutbound()); Session session = sut.retrieve(FAKE_CLIENT_ID); assertFalse(session.isClean()); }
Session retrieve(String clientID) { return pool.get(clientID); }
SessionRegistry { Session retrieve(String clientID) { return pool.get(clientID); } }
SessionRegistry { Session retrieve(String clientID) { return pool.get(clientID); } SessionRegistry(ISubscriptionsDirectory subscriptionsDirectory,
                    IQueueRepository queueRepository,
                    Authorizator authorizator); }
SessionRegistry { Session retrieve(String clientID) { return pool.get(clientID); } SessionRegistry(ISubscriptionsDirectory subscriptionsDirectory,
                    IQueueRepository queueRepository,
                    Authorizator authorizator); void remove(String clientID); void disconnect(String clientID); }
SessionRegistry { Session retrieve(String clientID) { return pool.get(clientID); } SessionRegistry(ISubscriptionsDirectory subscriptionsDirectory,
                    IQueueRepository queueRepository,
                    Authorizator authorizator); void remove(String clientID); void disconnect(String clientID);  }