fix TriggerRecurringTimeTest

This commit is contained in:
Milos Kozak 2020-05-24 19:42:58 +00:00
parent 0a33f4c0db
commit c1c87b2e30

View file

@ -1,6 +1,8 @@
package info.nightscout.androidaps.plugins.general.automation.triggers
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.MidnightTime
import info.nightscout.androidaps.utils.T
import org.json.JSONObject
import org.junit.Assert
import org.junit.Before
@ -14,9 +16,10 @@ import org.powermock.modules.junit4.PowerMockRunner
@PrepareForTest(DateUtil::class)
class TriggerRecurringTimeTest : TriggerTestBase() {
var now = 1514766900000L // 95 min from midnight
var now : Long = 0L
@Before fun mock() {
now = MidnightTime.calc() + T.mins(95).msecs() // 95 min from midnight
PowerMockito.`when`(dateUtil._now()).thenReturn(now)
}