@Test
    public void testUpgradeMigrationStateFrom34() throws Exception {
        try (LocalLogManagerTestEnv logEnv = new LocalLogManagerTestEnv.Builder(1).build()) {
            // In 3.4, we only wrote a PRE_MIGRATION to the log. In that software version, we defined this
            // as enum value 1. In 3.5+ software, this enum value is redefined as MIGRATION
            BootstrapMetadata bootstrapMetadata = BootstrapMetadata.fromVersion(MetadataVersion.IBP_3_4_IV0, "test");
            List<ApiMessageAndVersion> initialRecords = new ArrayList<>(bootstrapMetadata.records());
            initialRecords.add(ZkMigrationState.of((byte) 1).toRecord());
            logEnv.appendInitialRecords(initialRecords);
            try (
                QuorumControllerTestEnv controlEnv = new QuorumControllerTestEnv.Builder(logEnv).
                    setControllerBuilderInitializer(controllerBuilder ->
                        controllerBuilder.setZkMigrationEnabled(true)
                    ).
                    setBootstrapMetadata(bootstrapMetadata).
                    build()
            ) {
                QuorumController active = controlEnv.activeController();
                assertEquals(active.featureControl().zkMigrationState(), ZkMigrationState.MIGRATION);
                assertFalse(active.featureControl().inPreMigrationMode());
            }

            testToImages(logEnv.allRecords());
        }
    }
Test that certain controller operations finish immediately without putting an event
on the controller queue, if there is nothing to do.
metadata/src/test/java/org/apache/kafka/controller/QuorumControllerTest.java