class Neo4JDbDecorator implements TestMethodDecorator {

    @Override
    public void afterTest(final TestInvocation invocation) throws Exception {
        final ExecutionContext context = invocation.getContext();

        final Neo4JDbFeatureExecutor dbFeatureExecutor = new Neo4JDbFeatureExecutor(invocation.getFeatureResolver(),
                context.getDescriptor().getClasses());
        try (final Connection connection = (Connection) context.getData(Constants.KEY_CONNECTION)) {
            dbFeatureExecutor.executeAfterTest(connection, invocation.getException().isPresent());
        } finally {
            context.storeData(Constants.KEY_CONNECTION, null);
        }

    }

}