From d765fb1d5dd54c5ab6de8a878cd8717a0cb29273 Mon Sep 17 00:00:00 2001 From: Nicholas Tinsley Date: Thu, 12 Jan 2023 14:31:09 -0500 Subject: [PATCH] Fix androidTests for registration changes. --- .../app/changenumber/ChangeNumberViewModelTest.kt | 8 ++++---- .../thoughtcrime/securesms/testing/SignalActivityRule.kt | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/androidTest/java/org/thoughtcrime/securesms/components/settings/app/changenumber/ChangeNumberViewModelTest.kt b/app/src/androidTest/java/org/thoughtcrime/securesms/components/settings/app/changenumber/ChangeNumberViewModelTest.kt index 26a9e4538..00fc4f7fd 100644 --- a/app/src/androidTest/java/org/thoughtcrime/securesms/components/settings/app/changenumber/ChangeNumberViewModelTest.kt +++ b/app/src/androidTest/java/org/thoughtcrime/securesms/components/settings/app/changenumber/ChangeNumberViewModelTest.kt @@ -19,7 +19,7 @@ import org.thoughtcrime.securesms.keyvalue.SignalStore import org.thoughtcrime.securesms.pin.KbsRepository import org.thoughtcrime.securesms.recipients.Recipient import org.thoughtcrime.securesms.registration.VerifyAccountRepository -import org.thoughtcrime.securesms.registration.VerifyAccountResponseProcessor +import org.thoughtcrime.securesms.registration.VerifyResponseProcessor import org.thoughtcrime.securesms.testing.Get import org.thoughtcrime.securesms.testing.MockProvider import org.thoughtcrime.securesms.testing.Put @@ -117,7 +117,7 @@ class ChangeNumberViewModelTest { ) // WHEN - val processor: VerifyAccountResponseProcessor = viewModel.verifyCodeWithoutRegistrationLock("123456").blockingGet() + val processor: VerifyResponseProcessor = viewModel.verifyCodeWithoutRegistrationLock("123456").blockingGet() // THEN processor.isServerSentError() assertIs true @@ -148,7 +148,7 @@ class ChangeNumberViewModelTest { ) // WHEN - val processor: VerifyAccountResponseProcessor = viewModel.verifyCodeWithoutRegistrationLock("123456").blockingGet() + val processor: VerifyResponseProcessor = viewModel.verifyCodeWithoutRegistrationLock("123456").blockingGet() // THEN processor.isServerSentError() assertIs false @@ -195,7 +195,7 @@ class ChangeNumberViewModelTest { ) // WHEN - val processor: VerifyAccountResponseProcessor = viewModel.verifyCodeWithoutRegistrationLock("123456").blockingGet() + val processor: VerifyResponseProcessor = viewModel.verifyCodeWithoutRegistrationLock("123456").blockingGet() // THEN processor.isServerSentError() assertIs false diff --git a/app/src/androidTest/java/org/thoughtcrime/securesms/testing/SignalActivityRule.kt b/app/src/androidTest/java/org/thoughtcrime/securesms/testing/SignalActivityRule.kt index 282a22265..6e96f7f17 100644 --- a/app/src/androidTest/java/org/thoughtcrime/securesms/testing/SignalActivityRule.kt +++ b/app/src/androidTest/java/org/thoughtcrime/securesms/testing/SignalActivityRule.kt @@ -27,6 +27,7 @@ import org.thoughtcrime.securesms.recipients.RecipientId import org.thoughtcrime.securesms.registration.RegistrationData import org.thoughtcrime.securesms.registration.RegistrationRepository import org.thoughtcrime.securesms.registration.RegistrationUtil +import org.thoughtcrime.securesms.registration.VerifyResponse import org.thoughtcrime.securesms.util.Util import org.whispersystems.signalservice.api.profiles.SignalServiceProfile import org.whispersystems.signalservice.api.push.ACI @@ -74,7 +75,7 @@ class SignalActivityRule(private val othersCount: Int = 4) : ExternalResource() val registrationRepository = RegistrationRepository(application) InstrumentationApplicationDependencyProvider.addMockWebRequestHandlers(Put("/v2/keys") { MockResponse().success() }) - val response: ServiceResponse = registrationRepository.registerAccountWithoutRegistrationLock( + val response: ServiceResponse = registrationRepository.registerAccount( RegistrationData( code = "123123", e164 = "+15555550101", @@ -84,7 +85,7 @@ class SignalActivityRule(private val othersCount: Int = 4) : ExternalResource() fcmToken = null, pniRegistrationId = registrationRepository.pniRegistrationId ), - VerifyAccountResponse(UUID.randomUUID().toString(), UUID.randomUUID().toString(), false) + VerifyResponse(VerifyAccountResponse(UUID.randomUUID().toString(), UUID.randomUUID().toString(), false), null, null) ).blockingGet() ServiceResponseProcessor.DefaultProcessor(response).resultOrThrow