Drop iris.json settings migration

This commit is contained in:
piexel committed 2026-11-26 12:50:30 +01:00
1 parent 0bf7c346a2
commit 4141c0bead
2 files changed
+1 -68

No files matched your search

@@ -29,7 +29,6 @@ public class IrisSettingsFileTest {
private IrisPlatform previousPlatform;
private IrisSettings previousSettings;
private File settingsFile;
private File legacyFile;
@Before
public void bindPlatform() throws Exception {
@@ -38,7 +37,6 @@ public class IrisSettingsFileTest {
IrisPlatforms.unbind();
File dataFolder = temporaryFolder.newFolder("Iris");
settingsFile = new File(dataFolder, IrisSettingsFile.FILE_NAME);
legacyFile = new File(dataFolder, IrisSettingsFile.LEGACY_FILE_NAME);
IrisPlatform platform = mock(IrisPlatform.class);
doReturn(settingsFile).when(platform).dataFile(IrisSettingsFile.FILE_NAME);
IrisPlatforms.bind(platform);
@@ -78,29 +76,6 @@ public class IrisSettingsFileTest {
assertEquals(IrisSettingsFile.render(new IrisSettings()), Files.readString(settingsFile.toPath()));
}
@Test
public void legacyJsonMovesToToml() throws Exception {
Files.writeString(legacyFile.toPath(), "{\"general\":{\"debug\":true},\"pregen\":{\"runtimeSchedulerMode\":\"FOLIA\"}}");
IrisSettings loaded = IrisSettingsFile.load();
assertTrue(loaded.getGeneral().isDebug());
assertEquals(IrisRuntimeSchedulerMode.FOLIA, loaded.getPregen().getRuntimeSchedulerMode());
assertFalse(legacyFile.exists());
assertTrue(IrisSettingsFile.parse(Files.readString(settingsFile.toPath())).getGeneral().isDebug());
}
@Test
public void brokenLegacyJsonStaysWhereItIs() throws Exception {
Files.writeString(legacyFile.toPath(), "{\"general\":");
IrisSettings loaded = IrisSettingsFile.load();
assertFalse(loaded.getGeneral().isDebug());
assertEquals("{\"general\":", Files.readString(legacyFile.toPath()));
assertFalse(settingsFile.exists());
}
@Test
public void brokenTomlIsNotOverwritten() throws Exception {
String broken = "[general]\ndebug = tru\n";