DbUnitDatabaseConnectionDecorator implements TestClassDecorator { @Override public void afterAll(final TestInvocation invocation) throws Exception { final ExecutionContext context = invocation.getContext(); final IDatabaseConnection connection = (IDatabaseConnection) context.getData(Constants.KEY_CONNECTION); context.storeData(Constants.KEY_CONNECTION, null); connection.close(); }  @Override int getPriority(); @Override boolean isConfigurationSupported(final ExecutionContext ctx); @Override void beforeAll(final TestInvocation invocation); @Override void afterAll(final TestInvocation invocation);  }
@Test public void testAfterAll() throws Throwable { decorator.afterAll(invocation); verify(ctx).storeData(eq(Constants.KEY_CONNECTION), isNull()); verify(connection).close(); }