@Test
public void testStop() {

    // when calling stop()
    appender.setUri("mongodb://username:password@server/database.collection");
    appender.start();
    appender.doAppend(event);
    appender.stop();
    // then close MongoDB connection and stop appender
    Mockito.verify(mongoClient).close();
    assertFalse(appender.isStarted());
}