diff --git a/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.java b/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.java index f3577e35c8..cc54a8e72d 100644 --- a/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.java +++ b/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.java @@ -30,6 +30,8 @@ import info.nightscout.androidaps.plugins.pump.danaRS.DanaRSPlugin; import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin; import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin; import info.nightscout.androidaps.plugins.source.SourceGlimpPlugin; +import info.nightscout.androidaps.plugins.treatments.TreatmentService; +import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin; import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.androidaps.utils.SP; @@ -39,7 +41,7 @@ import static org.mockito.Mockito.when; * Created by mike on 18.03.2018. */ @RunWith(PowerMockRunner.class) -@PrepareForTest({MainApp.class, ConfigBuilderPlugin.class, FabricPrivacy.class, SP.class, Context.class, OpenAPSMAPlugin.class, OpenAPSAMAPlugin.class, OpenAPSSMBPlugin.class}) +@PrepareForTest({MainApp.class, ConfigBuilderPlugin.class, FabricPrivacy.class, SP.class, Context.class, OpenAPSMAPlugin.class, OpenAPSAMAPlugin.class, OpenAPSSMBPlugin.class, TreatmentsPlugin.class, TreatmentService.class}) public class ConstraintsCheckerTest { VirtualPumpPlugin pump = new VirtualPumpPlugin(); @@ -278,6 +280,8 @@ public class ConstraintsCheckerTest { AAPSMocker.mockStrings(); AAPSMocker.mockSP(); AAPSMocker.mockCommandQueue(); + AAPSMocker.mockTreatmentService(); + AAPSMocker.mockTreatmentPlugin(); when(mainApp.getPackageName()).thenReturn("info.nightscout.androidaps"); diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPluginTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPluginTest.java index 1dabf0ff30..c5ba9efcb7 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPluginTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPluginTest.java @@ -20,6 +20,8 @@ import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin; import info.nightscout.androidaps.plugins.aps.openAPSMA.OpenAPSMAPlugin; import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin; import info.nightscout.androidaps.plugins.source.SourceGlimpPlugin; +import info.nightscout.androidaps.plugins.treatments.TreatmentService; +import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin; import info.nightscout.androidaps.utils.SP; import static org.mockito.Mockito.when; @@ -29,7 +31,7 @@ import static org.mockito.Mockito.when; */ @RunWith(PowerMockRunner.class) -@PrepareForTest({MainApp.class, ConfigBuilderPlugin.class, SP.class, Context.class}) +@PrepareForTest({MainApp.class, ConfigBuilderPlugin.class, SP.class, Context.class, TreatmentsPlugin.class, TreatmentService.class}) public class SafetyPluginTest { private VirtualPumpPlugin pump = new VirtualPumpPlugin(); @@ -229,6 +231,8 @@ public class SafetyPluginTest { AAPSMocker.mockConstraintsChecker(); AAPSMocker.mockSP(); AAPSMocker.mockStrings(); + AAPSMocker.mockTreatmentService(); + AAPSMocker.mockTreatmentPlugin(); when(ConfigBuilderPlugin.getPlugin().getActivePump()).thenReturn(pump); diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.java index 84b7f4c3fa..a14513e7c0 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.java @@ -648,7 +648,7 @@ public class SmsCommunicatorPluginTest { passCode = smsCommunicatorPlugin.getMessageToConfirm().getConfirmCode(); smsCommunicatorPlugin.processSms(new Sms("1234", passCode)); Assert.assertEquals(passCode, smsCommunicatorPlugin.getMessages().get(2).getText()); - Assert.assertEquals("Extended bolus 1.00U for 20 min started successfully\nVirtual Pump", smsCommunicatorPlugin.getMessages().get(3).getText()); + Assert.assertEquals("Extended bolus 1.00U for 20 min started successfully\nnull\nVirtual Pump", smsCommunicatorPlugin.getMessages().get(3).getText()); } @Test