@Override
    protected void doStop() throws Exception {
        shutdownReconnectService(reconnectService);

        LOG.debug("Disconnecting from: {}...", getEndpoint().getConnectionString());

        super.doStop();
        closeSession();

        LOG.info("Disconnected from: {}", getEndpoint().getConnectionString());
    }
@Test
    public void doStopShouldCloseTheSMPPSession() throws Exception {
        doStartShouldStartANewSmppSession();
        reset(endpoint, processor, session);

        when(endpoint.getConnectionString())
                .thenReturn("smpp://smppclient@localhost:2775");

        consumer.doStop();

        verify(session).removeSessionStateListener(isA(SessionStateListener.class));
        verify(session).unbindAndClose();
    }