private MigrationVersion getTestDataVersion() {
        final String targetVersionStr = getTargetVersion().getVersion();
        final String[] parts = targetVersionStr.split("\\.");
        final int lastPart = Integer.parseInt(parts[parts.length - 1]);

        if (lastPart == 1) {
            throw new RuntimeException(LogUtil.message(
                    "Can't work with a part number of 1. targetVersionStr: '{}'. " +
                            "Make the last three digits of the script name a multiple of 5",
                    targetVersionStr));
        }
        final StringBuilder sb = new StringBuilder();
        for (int i = 0; i < parts.length - 1; i++) {
            sb.append(parts[i])
                    .append(".");
        }
        final String newLastPart = Strings.padStart(String.valueOf(lastPart - 1), 3, '0');
        sb.append(newLastPart)
                .append(".1");

        final MigrationVersion testDataVersion = MigrationVersion.fromVersion(sb.toString());
        LOGGER.debug("Using test data version number {}", testDataVersion);
        return testDataVersion;
    }
This is version of this test class which itself is a migration that is slotted
in just before the target version.
stroom-app/src/test/java/stroom/app/db/migration/AbstractCrossModuleMigrationTest.java