### Question:
FluentJUnitJupiter implements BeforeEachCallback, AfterEachCallback, AfterAllCallback { @Override public void afterEach(ExtensionContext context) { FluentTest instance = testInstanceOf(context); Optional<Throwable> throwable = context.getExecutionException(); if (throwable.isPresent()) { instance._failed(throwable.get(), testClassOf(context), testNameOf(context)); } else { instance._finished(testClassOf(context), testNameOf(context)); } }  @Override void beforeEach(ExtensionContext context); @Override void afterEach(ExtensionContext context); @Override void afterAll(ExtensionContext context);  }### Answer:
@Test void testAfterEachSuccessful() { when(context.getExecutionException()).thenReturn(Optional.empty()); sut.afterEach(context); verify(test)._finished(eq(Test1.class), eq("test1")); verify(test, never())._failed(any(), any(), any()); }
@Test void testAfterEachFailure() { final AssertionError error = new AssertionError("error"); when(context.getExecutionException()).thenReturn(Optional.of(error)); sut.afterEach(context); verify(test)._failed(same(error), eq(Test1.class), eq("test1")); verify(test, never())._finished(any(), any()); }