MongoDBAppenderBase extends UnsynchronizedAppenderBase<E> { @Override public void stop() { if (mongoClient != null) mongoClient.close(); super.stop(); } MongoDBAppenderBase();  MongoDBAppenderBase(MongoClientFactory factory); @Override void start(); @Override void stop(); void setUri(String uri);  }
@Test public void testStop() { appender.setUri("mongodb: appender.start(); appender.doAppend(event); appender.stop(); Mockito.verify(mongoClient).close(); assertFalse(appender.isStarted()); }