Neo4JDriverDecorator implements TestClassDecorator { @Override public void afterAll(final TestInvocation invocation) throws Exception { final ExecutionContext context = invocation.getContext(); final HikariDataSource ds = (HikariDataSource) context.getData(Constants.KEY_DATA_SOURCE); ds.close(); context.storeData(Constants.KEY_DATA_SOURCE, null); }  @Override int getPriority(); @Override boolean isConfigurationSupported(final ExecutionContext ctx); @Override void beforeAll(final TestInvocation invocation); @Override void afterAll(final TestInvocation invocation);  }
@Test public void testAfterTest() throws Throwable { decorator.afterAll(invocation); verify(dataSource).close(); verify(ctx).storeData(eq(Constants.KEY_DATA_SOURCE), isNull()); }