ConfigUpdater { public void applyConfigUpdate(Config config) throws IOException { ConfigChange[] configEnhancementsPatch = configEnhancementPatch(); applyChanges(config, configEnhancementsPatch); config.save(); } @Inject  ConfigUpdater(
            PluginLogger logger,
            ErrorLogger errorLogger
    ); void applyConfigUpdate(Config config);  }
@Test void serverConfigIsPatchedCorrectly() throws IOException, IllegalAccessException { Path config = tempDir.resolve("oldconfig.yml"); Files.copy(oldConfig.toPath(), config, StandardCopyOption.REPLACE_EXISTING); PlanConfig planConfig = new PlanConfig(config.toFile(), null, null, new TestPluginLogger()); UNDER_TEST.applyConfigUpdate(planConfig); copyMissingFrom(planConfig, newConfig); Collection<Setting> settings = ConfigSettingKeyTest.getServerSettings(); ConfigSettingKeyTest.assertValidDefaultValuesForAllSettings(planConfig, settings); }
@Test void proxyConfigIsPatchedCorrectly() throws IOException, IllegalAccessException { Path config = tempDir.resolve("oldconfig.yml"); Files.copy(oldBungeeConfig.toPath(), config, StandardCopyOption.REPLACE_EXISTING); PlanConfig planConfig = new PlanConfig(config.toFile(), null, null, new TestPluginLogger()); UNDER_TEST.applyConfigUpdate(planConfig); copyMissingFrom(planConfig, newBungeeConfig); Collection<Setting> settings = ConfigSettingKeyTest.getProxySettings(); ConfigSettingKeyTest.assertValidDefaultValuesForAllSettings(planConfig, settings); }