diff --git a/app/src/test/java/info/AAPSMocker.java b/app/src/test/java/info/AAPSMocker.java index fc80b39e4d..f1ec982f9b 100644 --- a/app/src/test/java/info/AAPSMocker.java +++ b/app/src/test/java/info/AAPSMocker.java @@ -104,7 +104,6 @@ public class AAPSMocker { when(MainApp.gs(R.string.profile_per_unit)).thenReturn("/U"); when(MainApp.gs(R.string.profile_carbs_per_unit)).thenReturn("g/U"); when(MainApp.gs(R.string.profile_ins_units_per_hout)).thenReturn("U/h"); - when(MainApp.gs(R.string.diskfull)).thenReturn("Free at least 200Mb from internal storage! Loop disabled!"); } public static MainApp mockMainApp() { diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/storage/StorageConstraintPluginTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/storage/StorageConstraintPluginTest.java index 5bc5cfacbe..34c064a214 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/storage/StorageConstraintPluginTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/storage/StorageConstraintPluginTest.java @@ -43,13 +43,11 @@ public class StorageConstraintPluginTest extends StorageConstraintPlugin{ when(StorageConstraintPlugin.getAvailableInternalMemorySize()).thenReturn(150L); Constraint c = new Constraint<>(true); c = storageConstraintPlugin.isClosedLoopAllowed(c); - Assert.assertEquals(true, c.getReasons().contains(MainApp.gs(R.string.diskfull))); Assert.assertEquals(Boolean.FALSE, c.value()); // Set free space over 200(Mb) to enable loop when(StorageConstraintPlugin.getAvailableInternalMemorySize()).thenReturn(300L); Constraint c2 = new Constraint<>(true); c2 = storageConstraintPlugin.isClosedLoopAllowed(c2); - Assert.assertEquals(false, c2.getReasons().contains(MainApp.gs(R.string.diskfull))); Assert.assertEquals(Boolean.TRUE, c2.value()); } @@ -74,6 +72,7 @@ public class StorageConstraintPluginTest extends StorageConstraintPlugin{ public void prepareMock() { AAPSMocker.mockMainApp(); AAPSMocker.mockStrings(); + AAPSMocker.mockBus(); mockedFile = mock(File.class); mockedStatFs = mock(StatFs.class); storageConstraintPlugin = StorageConstraintPlugin.getPlugin();