diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index da5b8116df..2497976c0c 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -6,7 +6,6 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.core.profile.ProfileSealed import info.nightscout.core.profile.ProfileStoreObject -import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Config import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.interfaces.profile.DefaultValueHelper @@ -34,7 +33,6 @@ open class TestBaseWithProfile : TestBase() { @Mock lateinit var config: Config @Mock lateinit var sp: SP @Mock lateinit var context: Context - @Mock lateinit var repository: AppRepository private lateinit var hardLimits: HardLimits lateinit var testPumpPlugin: TestPumpPlugin diff --git a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt index b7c68016a8..6f4072efee 100644 --- a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt @@ -21,6 +21,7 @@ import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.Config import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.constraints.Constraints +import info.nightscout.interfaces.db.PersistenceLayer import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.interfaces.pump.DetailedBolusInfo @@ -56,6 +57,7 @@ class CommandQueueImplementationTest : TestBaseWithProfile() { @Mock lateinit var repository: AppRepository @Mock lateinit var activityNames: ActivityNames @Mock lateinit var androidPermission: AndroidPermission + @Mock lateinit var persistenceLayer: PersistenceLayer class CommandQueueMocked( injector: HasAndroidInjector, @@ -73,11 +75,12 @@ class CommandQueueImplementationTest : TestBaseWithProfile() { repository: AppRepository, fabricPrivacy: FabricPrivacy, androidPermission: AndroidPermission, - activityNames: ActivityNames + activityNames: ActivityNames, + persistenceLayer: PersistenceLayer ) : CommandQueueImplementation( injector, aapsLogger, rxBus, aapsSchedulers, rh, constraintChecker, profileFunction, activePlugin, context, sp, config, dateUtil, repository, fabricPrivacy, - androidPermission, activityNames + androidPermission, activityNames, persistenceLayer ) { override fun notifyAboutNewCommand() : Boolean = true @@ -121,7 +124,7 @@ class CommandQueueImplementationTest : TestBaseWithProfile() { injector, aapsLogger, rxBus, aapsSchedulers, rh, constraintChecker, profileFunction, activePlugin, context, sp, config, dateUtil, repository, - fabricPrivacy, androidPermission, activityNames + fabricPrivacy, androidPermission, activityNames, persistenceLayer ) testPumpPlugin = TestPumpPlugin(injector) @@ -158,7 +161,7 @@ class CommandQueueImplementationTest : TestBaseWithProfile() { val commandQueue = CommandQueueImplementation( injector, aapsLogger, rxBus, aapsSchedulers, rh, constraintChecker, profileFunction, activePlugin, context, sp, - config, dateUtil, repository, fabricPrivacy, androidPermission, activityNames + config, dateUtil, repository, fabricPrivacy, androidPermission, activityNames, persistenceLayer ) val handler = mock(Handler::class.java) `when`(handler.post(anyObject())).thenAnswer { invocation: InvocationOnMock -> diff --git a/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt b/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt index 120c5614da..e4e2dac003 100644 --- a/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt @@ -12,6 +12,7 @@ import info.nightscout.implementation.queue.commands.CommandTempBasalAbsolute import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.constraints.Constraints +import info.nightscout.interfaces.db.PersistenceLayer import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.PumpDescription @@ -34,6 +35,7 @@ class QueueThreadTest : TestBaseWithProfile() { @Mock lateinit var repository: AppRepository @Mock lateinit var androidPermission: AndroidPermission @Mock lateinit var activityNames: ActivityNames + @Mock lateinit var persistenceLayer: PersistenceLayer val injector = HasAndroidInjector { AndroidInjector { @@ -58,7 +60,7 @@ class QueueThreadTest : TestBaseWithProfile() { commandQueue = CommandQueueImplementation( injector, aapsLogger, rxBus, aapsSchedulers, rh, constraintChecker, profileFunction, activePlugin, context, sp, - config, dateUtil, repository, fabricPrivacy, androidPermission, activityNames + config, dateUtil, repository, fabricPrivacy, androidPermission, activityNames, persistenceLayer ) val pumpDescription = PumpDescription()