@Override
    protected void doStart() throws Exception {
        super.doStart();

        if (!getConfiguration().isLazySessionCreation()) {
            if (connectLock.tryLock()) {
                try {
                    session = createSession();
                } finally {
                    connectLock.unlock();
                }
            } else {
                LOG.warn("Thread {} could not acquire a lock for creating the session during producer start",
                        Thread.currentThread().getId());
            }
        }
    }
@Test
    public void doStartShouldStartANewSmppSession() throws Exception {
        when(endpoint.getConnectionString())
                .thenReturn("smpp://smppclient@localhost:2775");
        BindParameter expectedBindParameters = new BindParameter(
                BindType.BIND_TX,
                "smppclient",
                "password",
                "cp",
                TypeOfNumber.UNKNOWN,
                NumberingPlanIndicator.UNKNOWN,
                "",
                InterfaceVersion.IF_50);
        when(session.connectAndBind("localhost", Integer.valueOf(2775), expectedBindParameters))
                .thenReturn("1");
        when(endpoint.isSingleton()).thenReturn(true);

        producer.doStart();

        verify(session).setEnquireLinkTimer(60000);
        verify(session).setTransactionTimer(10000);
        verify(session).addSessionStateListener(isA(SessionStateListener.class));
        verify(session).connectAndBind("localhost", Integer.valueOf(2775), expectedBindParameters);
    }