fix tests

This commit is contained in:
Milos Kozak 2021-02-03 12:03:46 +01:00
parent c353da5767
commit bfd33502e6

View file

@ -7,6 +7,7 @@ import info.nightscout.androidaps.R
import info.nightscout.androidaps.TestBase
import info.nightscout.androidaps.logging.AAPSLogger
import info.nightscout.androidaps.plugins.general.smsCommunicator.otp.OneTimePassword
import info.nightscout.androidaps.plugins.general.smsCommunicator.otp.OneTimePasswordValidationResult
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.T
import info.nightscout.androidaps.utils.resources.ResourceHelper
@ -75,6 +76,7 @@ class AuthRequestTest : TestBase() {
// correct reply
authRequest = AuthRequest(injector, requester, "Request text", "ABC", action)
actionCalled = false
`when`(otp.checkOTP(anyObject())).thenReturn(OneTimePasswordValidationResult.OK)
authRequest.action("ABC")
Assert.assertTrue(actionCalled)
// second time action should not be called