@Override
    protected void doStart() throws Exception {
        super.doStart();
        listener = getListener();
        connection.addIRCEventListener(listener);

        LOG.debug("Sleeping for {} seconds before sending commands.", configuration.getCommandTimeout() / 1000);
        // sleep for a few seconds as the server sometimes takes a moment to fully connect, print banners, etc after connection established
        try {
            Thread.sleep(configuration.getCommandTimeout());
        } catch (InterruptedException ex) {
            LOG.info("Interrupted while sleeping before sending commands");
            Thread.currentThread().interrupt();
        }
        if (ObjectHelper.isNotEmpty(configuration.getNickPassword())) {
            LOG.debug("Identifying and enforcing nick with NickServ.");
            // Identify nick and enforce, https://meta.wikimedia.org/wiki/IRC/Instructions#Register_your_nickname.2C_identify.2C_and_enforce
            connection.doPrivmsg("nickserv", "identify " + configuration.getNickPassword());
            connection.doPrivmsg("nickserv", "set enforce on");
        }

        endpoint.joinChannels();
    }
@Test
    public void doStartTest() throws Exception {
        consumer.doStart();

        verify(connection).addIRCEventListener(listener);
        verify(endpoint).joinChannels();
    }