Fix tests loophubtest.kt

This commit is contained in:
swissalpine 2023-11-26 23:28:35 +01:00 committed by GitHub
parent 3fcdad5275
commit 3f59d4eb66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,9 +10,11 @@ import app.aaps.core.interfaces.iob.IobTotal
import app.aaps.core.interfaces.logging.UserEntryLogger
import app.aaps.core.interfaces.profile.Profile
import app.aaps.core.interfaces.profile.ProfileFunction
import app.aaps.core.interfaces.profile.ProfileUtil
import app.aaps.core.interfaces.pump.DetailedBolusInfo
import app.aaps.core.interfaces.queue.CommandQueue
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.main.graph.OverviewData
import app.aaps.database.ValueWrapper
import app.aaps.database.entities.EffectiveProfileSwitch
import app.aaps.database.entities.GlucoseValue
@ -54,6 +56,8 @@ class LoopHubTest: TestBase() {
@Mock lateinit var repo: AppRepository
@Mock lateinit var userEntryLogger: UserEntryLogger
@Mock lateinit var sp: SP
@Mock lateinit var overviewData: OverviewData
@Mock lateinit var profileUtil: ProfileUtil
private lateinit var loopHub: LoopHubImpl
private val clock = Clock.fixed(Instant.ofEpochMilli(10_000), ZoneId.of("UTC"))
@ -62,7 +66,7 @@ class LoopHubTest: TestBase() {
fun setup() {
loopHub = LoopHubImpl(
aapsLogger, commandQueue, constraints, iobCobCalculator, loop,
profileFunction, repo, userEntryLogger, sp
profileFunction, repo, userEntryLogger, sp, overviewData, profileUtil
)
loopHub.clock = clock
}
@ -76,6 +80,8 @@ class LoopHubTest: TestBase() {
verifyNoMoreInteractions(profileFunction)
verifyNoMoreInteractions(repo)
verifyNoMoreInteractions(userEntryLogger)
verifyNoMoreInteractions(overviewData)
verifyNoMoreInteractions(profileUtil)
}
@Test
@ -247,4 +253,4 @@ class LoopHubTest: TestBase() {
samplingStart, samplingEnd, 101, "Test Device")
verify(repo).runTransaction(InsertOrUpdateHeartRateTransaction(hr))
}
}
}