@Override
    public void testPlanExecutionFinished(TestPlan testPlan) {
        // Called after all tests have run on this JVM.
        LOGGER.info("Finished test plan");

//        clearDropwizardMetricsRegistry();

        TestClassLogger.writeTestClassesLogToDisk();

        if (DbTestUtil.isDbAvailable()) {
            if (keepTestDatabases()) {
                LOGGER.info("{}=true so won't drop all test databases.", KEEP_TEST_DATABASES);
            } else {
                LOGGER.info("Dropping test database for current gradle worker. Set {}=true to prevent this.",
                        KEEP_TEST_DATABASES);
                DbTestUtil.dropUnusedTestDatabases();
            }
        }
    }
This test listener is registered by service loader using the file
stroom-test-common/src/main/resources/META-INF/services/org.junit.platform.launcher.TestExecutionListener
Its methods will be called for any tests that include stroom-test-common as a dependency.
stroom-test-common/src/main/java/stroom/test/common/util/test/StroomTestExecutionListener.java