private Module getDbConnectionsModule() {
        return new DbConnectionsModule() {

            @Override
            protected CrossModuleDbMigrationsModule getCrossModuleDbMigrationsModule() {

                return new CrossModuleDbMigrationsModule() {

                    @Override
                    protected Optional<MigrationVersion> getMigrationTarget() {
                        // This is the version of the mig under test
                        // This ensures we only run migrations up to the version under test
                        return Optional.ofNullable(targetVersion);
                    }

                    @Override
                    protected List<Class<? extends JavaMigration>> getAdditionalMigrationClasses() {
                        // Get the subclass to tell us what test data class is being used as a 'migration'
                        // to load test data prior to the migration under test.
                        return List.of(AbstractCrossModuleMigrationTest.this.getTestDataClass());
                    }
                };
            }
        };
    }
Get an instance of a datasource for use when asserting database state after the migration has
been run.
stroom-app/src/test/java/stroom/app/db/migration/AbstractCrossModuleMigrationTest.java