Fix missing dependency in tests
This commit is contained in:
parent
00e36392bd
commit
f98d310a8e
4 changed files with 7 additions and 9 deletions
|
@ -4,7 +4,7 @@ import app.aaps.core.interfaces.plugin.ActivePlugin
|
||||||
import app.aaps.core.interfaces.pump.PumpSync
|
import app.aaps.core.interfaces.pump.PumpSync
|
||||||
import app.aaps.core.interfaces.resources.ResourceHelper
|
import app.aaps.core.interfaces.resources.ResourceHelper
|
||||||
import app.aaps.core.interfaces.sharedPreferences.SP
|
import app.aaps.core.interfaces.sharedPreferences.SP
|
||||||
import app.aaps.shared.tests.TestBase
|
import app.aaps.shared.tests.TestBaseWithProfile
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil
|
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil
|
||||||
|
@ -16,15 +16,13 @@ import info.nightscout.pump.common.sync.PumpSyncStorage
|
||||||
import org.mockito.Answers
|
import org.mockito.Answers
|
||||||
import org.mockito.Mock
|
import org.mockito.Mock
|
||||||
|
|
||||||
open class MedtronicTestBase : TestBase() {
|
open class MedtronicTestBase : TestBaseWithProfile() {
|
||||||
|
|
||||||
var rileyLinkUtil = RileyLinkUtil()
|
var rileyLinkUtil = RileyLinkUtil()
|
||||||
|
|
||||||
@Mock lateinit var pumpSync: PumpSync
|
@Mock lateinit var pumpSync: PumpSync
|
||||||
@Mock lateinit var pumpSyncStorage: PumpSyncStorage
|
@Mock lateinit var pumpSyncStorage: PumpSyncStorage
|
||||||
@Mock(answer = Answers.RETURNS_DEEP_STUBS) lateinit var activePlugin: ActivePlugin
|
@Mock(answer = Answers.RETURNS_DEEP_STUBS) override lateinit var activePlugin: ActivePlugin
|
||||||
@Mock lateinit var sp: SP
|
|
||||||
@Mock lateinit var rh: ResourceHelper
|
|
||||||
|
|
||||||
lateinit var medtronicUtil: MedtronicUtil
|
lateinit var medtronicUtil: MedtronicUtil
|
||||||
lateinit var decoder: MedtronicPumpHistoryDecoder
|
lateinit var decoder: MedtronicPumpHistoryDecoder
|
||||||
|
|
|
@ -40,7 +40,7 @@ import org.mockito.Mock
|
||||||
decoder = MedtronicPumpHistoryDecoder(aapsLogger, medtronicUtil)
|
decoder = MedtronicPumpHistoryDecoder(aapsLogger, medtronicUtil)
|
||||||
medtronicHistoryData = MedtronicHistoryData(
|
medtronicHistoryData = MedtronicHistoryData(
|
||||||
packetInjector, aapsLogger, sp, rh, rxBus, activePlugin,
|
packetInjector, aapsLogger, sp, rh, rxBus, activePlugin,
|
||||||
medtronicUtil, decoder, medtronicPumpStatus, pumpSync, pumpSyncStorage, uiInteraction
|
medtronicUtil, decoder, medtronicPumpStatus, pumpSync, pumpSyncStorage, uiInteraction, profileUtil
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ class MedtronicHistoryDataUTest : MedtronicTestBase() {
|
||||||
|
|
||||||
val unitToTest = MedtronicHistoryData(
|
val unitToTest = MedtronicHistoryData(
|
||||||
packetInjector, aapsLogger, sp, rh, rxBus, activePlugin,
|
packetInjector, aapsLogger, sp, rh, rxBus, activePlugin,
|
||||||
medtronicUtil, decoder, medtronicPumpStatus, pumpSync, pumpSyncStorage, uiInteraction
|
medtronicUtil, decoder, medtronicPumpStatus, pumpSync, pumpSyncStorage, uiInteraction, profileUtil
|
||||||
)
|
)
|
||||||
|
|
||||||
val gson = Gson()
|
val gson = Gson()
|
||||||
|
@ -75,7 +75,7 @@ class MedtronicHistoryDataUTest : MedtronicTestBase() {
|
||||||
medtronicUtil, decoder,
|
medtronicUtil, decoder,
|
||||||
medtronicPumpStatus,
|
medtronicPumpStatus,
|
||||||
pumpSync,
|
pumpSync,
|
||||||
pumpSyncStorage, uiInteraction
|
pumpSyncStorage, uiInteraction, profileUtil
|
||||||
)
|
)
|
||||||
|
|
||||||
val gson = Gson()
|
val gson = Gson()
|
||||||
|
|
|
@ -36,7 +36,7 @@ import org.mockito.invocation.InvocationOnMock
|
||||||
@Suppress("SpellCheckingInspection")
|
@Suppress("SpellCheckingInspection")
|
||||||
open class TestBaseWithProfile : TestBase() {
|
open class TestBaseWithProfile : TestBase() {
|
||||||
|
|
||||||
@Mock lateinit var activePlugin: ActivePlugin
|
@Mock open lateinit var activePlugin: ActivePlugin
|
||||||
@Mock lateinit var rh: ResourceHelper
|
@Mock lateinit var rh: ResourceHelper
|
||||||
@Mock lateinit var iobCobCalculator: IobCobCalculator
|
@Mock lateinit var iobCobCalculator: IobCobCalculator
|
||||||
@Mock lateinit var fabricPrivacy: FabricPrivacy
|
@Mock lateinit var fabricPrivacy: FabricPrivacy
|
||||||
|
|
Loading…
Reference in a new issue