@Test
public void testMongoClientIsClosedEvenIfExecuteAfterTestFails() throws Throwable {

    // GIVEN
    when(invocation.getException()).thenReturn(Optional.of(new Exception()));
    doThrow(RuntimeException.class).when(executor).executeAfterTest(any(MongoDatabase.class), anyBoolean());
    // WHEN
    try {
        decorator.afterTest(invocation);
        fail("Exception expected");
    } catch (final Exception e) {
        // expected
    }
    // THEN
    verifyZeroInteractions(mongoClient);
}