From 7bf17a1f5c5221aa80feac6bac48c9ecee21a152 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 9 Sep 2018 12:56:48 +0200 Subject: [PATCH] fix test --- .../nightscout/androidaps/plugins/Loop/APSResultTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/Loop/APSResultTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/Loop/APSResultTest.java index 1505004535..d5fe95c49d 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/Loop/APSResultTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/Loop/APSResultTest.java @@ -6,6 +6,7 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.Mockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; @@ -23,6 +24,8 @@ import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin; import info.nightscout.utils.JsonHelper; import info.nightscout.utils.SP; +import static org.mockito.ArgumentMatchers.anyDouble; +import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyLong; import static org.powermock.api.mockito.PowerMockito.when; @@ -187,5 +190,8 @@ public class APSResultTest { when(ConfigBuilderPlugin.getActivePump()).thenReturn(virtualPumpPlugin); when(constraintChecker.isClosedLoopAllowed()).thenReturn(closedLoopEnabled); + + Mockito.when(SP.getDouble(anyInt(), anyDouble())).thenReturn(30d); + } }