kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix androidTests for registration changes.
rodzic
bce2dd1d1b
commit
d765fb1d5d
|
@ -19,7 +19,7 @@ import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||||
import org.thoughtcrime.securesms.pin.KbsRepository
|
import org.thoughtcrime.securesms.pin.KbsRepository
|
||||||
import org.thoughtcrime.securesms.recipients.Recipient
|
import org.thoughtcrime.securesms.recipients.Recipient
|
||||||
import org.thoughtcrime.securesms.registration.VerifyAccountRepository
|
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.Get
|
||||||
import org.thoughtcrime.securesms.testing.MockProvider
|
import org.thoughtcrime.securesms.testing.MockProvider
|
||||||
import org.thoughtcrime.securesms.testing.Put
|
import org.thoughtcrime.securesms.testing.Put
|
||||||
|
@ -117,7 +117,7 @@ class ChangeNumberViewModelTest {
|
||||||
)
|
)
|
||||||
|
|
||||||
// WHEN
|
// WHEN
|
||||||
val processor: VerifyAccountResponseProcessor = viewModel.verifyCodeWithoutRegistrationLock("123456").blockingGet()
|
val processor: VerifyResponseProcessor = viewModel.verifyCodeWithoutRegistrationLock("123456").blockingGet()
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
processor.isServerSentError() assertIs true
|
processor.isServerSentError() assertIs true
|
||||||
|
@ -148,7 +148,7 @@ class ChangeNumberViewModelTest {
|
||||||
)
|
)
|
||||||
|
|
||||||
// WHEN
|
// WHEN
|
||||||
val processor: VerifyAccountResponseProcessor = viewModel.verifyCodeWithoutRegistrationLock("123456").blockingGet()
|
val processor: VerifyResponseProcessor = viewModel.verifyCodeWithoutRegistrationLock("123456").blockingGet()
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
processor.isServerSentError() assertIs false
|
processor.isServerSentError() assertIs false
|
||||||
|
@ -195,7 +195,7 @@ class ChangeNumberViewModelTest {
|
||||||
)
|
)
|
||||||
|
|
||||||
// WHEN
|
// WHEN
|
||||||
val processor: VerifyAccountResponseProcessor = viewModel.verifyCodeWithoutRegistrationLock("123456").blockingGet()
|
val processor: VerifyResponseProcessor = viewModel.verifyCodeWithoutRegistrationLock("123456").blockingGet()
|
||||||
|
|
||||||
// THEN
|
// THEN
|
||||||
processor.isServerSentError() assertIs false
|
processor.isServerSentError() assertIs false
|
||||||
|
|
|
@ -27,6 +27,7 @@ import org.thoughtcrime.securesms.recipients.RecipientId
|
||||||
import org.thoughtcrime.securesms.registration.RegistrationData
|
import org.thoughtcrime.securesms.registration.RegistrationData
|
||||||
import org.thoughtcrime.securesms.registration.RegistrationRepository
|
import org.thoughtcrime.securesms.registration.RegistrationRepository
|
||||||
import org.thoughtcrime.securesms.registration.RegistrationUtil
|
import org.thoughtcrime.securesms.registration.RegistrationUtil
|
||||||
|
import org.thoughtcrime.securesms.registration.VerifyResponse
|
||||||
import org.thoughtcrime.securesms.util.Util
|
import org.thoughtcrime.securesms.util.Util
|
||||||
import org.whispersystems.signalservice.api.profiles.SignalServiceProfile
|
import org.whispersystems.signalservice.api.profiles.SignalServiceProfile
|
||||||
import org.whispersystems.signalservice.api.push.ACI
|
import org.whispersystems.signalservice.api.push.ACI
|
||||||
|
@ -74,7 +75,7 @@ class SignalActivityRule(private val othersCount: Int = 4) : ExternalResource()
|
||||||
val registrationRepository = RegistrationRepository(application)
|
val registrationRepository = RegistrationRepository(application)
|
||||||
|
|
||||||
InstrumentationApplicationDependencyProvider.addMockWebRequestHandlers(Put("/v2/keys") { MockResponse().success() })
|
InstrumentationApplicationDependencyProvider.addMockWebRequestHandlers(Put("/v2/keys") { MockResponse().success() })
|
||||||
val response: ServiceResponse<VerifyAccountResponse> = registrationRepository.registerAccountWithoutRegistrationLock(
|
val response: ServiceResponse<VerifyResponse> = registrationRepository.registerAccount(
|
||||||
RegistrationData(
|
RegistrationData(
|
||||||
code = "123123",
|
code = "123123",
|
||||||
e164 = "+15555550101",
|
e164 = "+15555550101",
|
||||||
|
@ -84,7 +85,7 @@ class SignalActivityRule(private val othersCount: Int = 4) : ExternalResource()
|
||||||
fcmToken = null,
|
fcmToken = null,
|
||||||
pniRegistrationId = registrationRepository.pniRegistrationId
|
pniRegistrationId = registrationRepository.pniRegistrationId
|
||||||
),
|
),
|
||||||
VerifyAccountResponse(UUID.randomUUID().toString(), UUID.randomUUID().toString(), false)
|
VerifyResponse(VerifyAccountResponse(UUID.randomUUID().toString(), UUID.randomUUID().toString(), false), null, null)
|
||||||
).blockingGet()
|
).blockingGet()
|
||||||
|
|
||||||
ServiceResponseProcessor.DefaultProcessor(response).resultOrThrow
|
ServiceResponseProcessor.DefaultProcessor(response).resultOrThrow
|
||||||
|
|
Ładowanie…
Reference in New Issue