@Test
public void publishNoPublishToInactiveSession() {

    // create an inactive session for Subscriber
    ISubscriptionsDirectory mockedSubscriptions = mock(ISubscriptionsDirectory.class);
    Subscription inactiveSub = new Subscription("Subscriber", new Topic("/topic"), MqttQoS.AT_LEAST_ONCE);
    List<Subscription> inactiveSubscriptions = Collections.singletonList(inactiveSub);
    when(mockedSubscriptions.matches(eq(new Topic("/topic")))).thenReturn(inactiveSubscriptions);
    m_processor = new ProtocolProcessor();
    m_processor.init(mockedSubscriptions, m_messagesStore, m_sessionStore, null, true, new PermitAllAuthorizator(),
            NO_OBSERVERS_INTERCEPTOR, this.sessionsRepository);
    m_processor.sessionsRepository.createNewSession("Subscriber", false);
    // Exercise
    connectAsClient("Publisher");
    publishToAs("Publisher", "/topic", AT_MOST_ONCE, true);
    verifyNoPublishIsReceived();
}