fix tests

This commit is contained in:
Milos Kozak 2023-10-15 20:10:53 +02:00
parent 970923df03
commit 0a011ab30d
6 changed files with 4 additions and 14 deletions

View file

@ -28,10 +28,8 @@ import app.aaps.database.entities.TherapyEvent
import app.aaps.database.entities.embedments.InsulinConfiguration
import app.aaps.database.entities.embedments.InterfaceIDs
import app.aaps.database.impl.AppRepository
import app.aaps.plugins.sync.nsShared.NsIncomingDataProcessor
import app.aaps.plugins.sync.nsShared.StoreDataForDbImpl
import app.aaps.plugins.sync.nsclient.ReceiverDelegate
import app.aaps.plugins.sync.nsclient.data.NSDeviceStatusHandler
import app.aaps.plugins.sync.nsclient.extensions.fromConstant
import app.aaps.shared.tests.TestBaseWithProfile
import com.google.common.truth.Truth.assertThat
@ -55,8 +53,6 @@ internal class NSClientV3PluginTest : TestBaseWithProfile() {
@Mock lateinit var nsClientSource: NSClientSource
@Mock lateinit var virtualPump: VirtualPump
@Mock lateinit var mockedProfileFunction: ProfileFunction
@Mock lateinit var nsDeviceStatusHandler: NSDeviceStatusHandler
@Mock lateinit var nsIncomingDataProcessor: NsIncomingDataProcessor
@Mock lateinit var repository: AppRepository
@Mock lateinit var persistenceLayer: PersistenceLayer
@Mock lateinit var insulin: Insulin
@ -83,8 +79,8 @@ internal class NSClientV3PluginTest : TestBaseWithProfile() {
sut =
NSClientV3Plugin(
injector, aapsLogger, aapsSchedulers, rxBus, rh, context, fabricPrivacy,
sp, receiverDelegate, config, dateUtil, uiInteraction, dataSyncSelectorV3, persistenceLayer,
nsDeviceStatusHandler, nsClientSource, nsIncomingDataProcessor, storeDataForDb, decimalFormatter
sp, receiverDelegate, config, dateUtil, dataSyncSelectorV3, persistenceLayer,
nsClientSource, storeDataForDb, decimalFormatter
)
sut.nsAndroidClient = nsAndroidClient
Mockito.`when`(mockedProfileFunction.getProfile(anyLong())).thenReturn(validProfile)

View file

@ -13,7 +13,6 @@ import app.aaps.core.interfaces.receivers.ReceiverStatusStore
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.source.NSClientSource
import app.aaps.core.interfaces.ui.UiInteraction
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.DecimalFormatter
import app.aaps.core.interfaces.utils.fabric.FabricPrivacy
@ -23,9 +22,7 @@ import app.aaps.core.utils.receivers.DataWorkerStorage
import app.aaps.database.entities.GlucoseValue
import app.aaps.database.entities.embedments.InterfaceIDs
import app.aaps.implementation.utils.DecimalFormatterImpl
import app.aaps.plugins.sync.nsShared.NsIncomingDataProcessor
import app.aaps.plugins.sync.nsclient.ReceiverDelegate
import app.aaps.plugins.sync.nsclient.data.NSDeviceStatusHandler
import app.aaps.plugins.sync.nsclientV3.DataSyncSelectorV3
import app.aaps.plugins.sync.nsclientV3.NSClientV3Plugin
import app.aaps.plugins.sync.nsclientV3.extensions.toNSSvgV3
@ -54,16 +51,13 @@ internal class LoadBgWorkerTest : TestBase() {
@Mock lateinit var nsAndroidClient: NSAndroidClient
@Mock lateinit var rh: ResourceHelper
@Mock lateinit var config: Config
@Mock lateinit var uiInteraction: UiInteraction
@Mock lateinit var dataSyncSelectorV3: DataSyncSelectorV3
@Mock lateinit var persistenceLayer: PersistenceLayer
@Mock lateinit var receiverStatusStore: ReceiverStatusStore
@Mock lateinit var nsClientSource: NSClientSource
@Mock lateinit var workManager: WorkManager
@Mock lateinit var workContinuation: WorkContinuation
@Mock lateinit var nsDeviceStatusHandler: NSDeviceStatusHandler
@Mock lateinit var storeDataForDb: StoreDataForDb
@Mock lateinit var nsIncomingDataProcessor: NsIncomingDataProcessor
@Mock lateinit var context: ContextWithInjector
private lateinit var nsClientV3Plugin: NSClientV3Plugin
@ -101,8 +95,8 @@ internal class LoadBgWorkerTest : TestBase() {
receiverDelegate = ReceiverDelegate(rxBus, rh, sp, receiverStatusStore, aapsSchedulers, fabricPrivacy)
nsClientV3Plugin = NSClientV3Plugin(
injector, aapsLogger, aapsSchedulers, rxBus, rh, context, fabricPrivacy,
sp, receiverDelegate, config, dateUtil, uiInteraction, dataSyncSelectorV3, persistenceLayer,
nsDeviceStatusHandler, nsClientSource, nsIncomingDataProcessor, storeDataForDb, decimalFormatter
sp, receiverDelegate, config, dateUtil, dataSyncSelectorV3, persistenceLayer,
nsClientSource, storeDataForDb, decimalFormatter
)
nsClientV3Plugin.newestDataOnServer = LastModified(LastModified.Collections())
}