Fix missing dependency in tests

This commit is contained in:
Jakub Kuczys 2023-12-02 01:19:38 +01:00
parent 00e36392bd
commit f98d310a8e
No known key found for this signature in database
GPG key ID: 9F02686F15FCBCD3
4 changed files with 7 additions and 9 deletions

View file

@ -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

View file

@ -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
) )

View file

@ -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()

View file

@ -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