JpaUnit implements BeforeAllCallback, AfterAllCallback, BeforeEachCallback, AfterEachCallback { @Override public void afterAll(final ExtensionContext context) throws Exception { executor.processAfterAll(createTestMethodInvocation(context, true)); }  @Override void beforeAll(final ExtensionContext context); @Override void afterAll(final ExtensionContext context); @Override void beforeEach(final ExtensionContext context); @Override void afterEach(final ExtensionContext context);  }
@Test public void testAfterAllTestDecoratorExecutionOrder() throws Exception { final JpaUnit unit = new JpaUnit(); unit.afterAll(context); final ArgumentCaptor<TestInvocation> invocationCaptor = ArgumentCaptor.forClass(TestInvocation.class); final InOrder order = inOrder(secondClassDecorator, firstClassDecorator); order.verify(secondClassDecorator).afterAll(invocationCaptor.capture()); assertThat(invocationCaptor.getValue().getTestClass(), equalTo(testClass)); order.verify(firstClassDecorator).afterAll(invocationCaptor.capture()); assertThat(invocationCaptor.getValue().getTestClass(), equalTo(testClass)); verifyZeroInteractions(firstMethodDecorator, secondMethodDecorator); }