From dad6611d77ee3d6984af5697896b027b977994ca Mon Sep 17 00:00:00 2001 From: Niklas Berglund Date: Mon, 19 Aug 2024 10:31:47 +0200 Subject: [PATCH] Revert "Temporary hack for testing if firebase invoke tests differently" This reverts commit 4ef992d8a5db50b945dacb056c4a80b1f86e5176. --- .../test/e2e/misc/AccountTestRule.kt | 32 ++++--------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/misc/AccountTestRule.kt b/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/misc/AccountTestRule.kt index ee0749f31f6c..333f4cde8809 100644 --- a/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/misc/AccountTestRule.kt +++ b/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/misc/AccountTestRule.kt @@ -10,15 +10,15 @@ import org.junit.jupiter.api.extension.ExtensionContext class AccountTestRule : BeforeEachCallback { - private var partnerAccount = "" + private val partnerAccount: String? private val client = SimpleMullvadHttpClient(InstrumentationRegistry.getInstrumentation().targetContext) - var validAccountNumber = "" - var invalidAccountNumber = "" + val validAccountNumber: String + val invalidAccountNumber: String init { - /*InstrumentationRegistry.getArguments().also { bundle -> + InstrumentationRegistry.getArguments().also { bundle -> partnerAccount = bundle.getString(PARTNER_AUTH) if (partnerAccount != null) { @@ -34,30 +34,10 @@ class AccountTestRule : BeforeEachCallback { client.removeAllDevices(validAccountNumber) } - invalidAccountNumber = - bundle.getRequiredArgument(INVALID_TEST_ACCOUNT_NUMBER_ARGUMENT_KEY) - }*/ - } - - override fun beforeEach(context: ExtensionContext) { - InstrumentationRegistry.getArguments().also { bundle -> - partnerAccount = bundle.getString(PARTNER_AUTH).toString() - - if (partnerAccount != null && partnerAccount != "null") { - validAccountNumber = client.createAccount() - client.addTimeToAccountUsingPartnerAuth( - accountNumber = validAccountNumber, - daysToAdd = 1, - partnerAuth = partnerAccount - ) - } else { - validAccountNumber = - bundle.getRequiredArgument(VALID_TEST_ACCOUNT_NUMBER_ARGUMENT_KEY) - client.removeAllDevices(validAccountNumber) - } - invalidAccountNumber = bundle.getRequiredArgument(INVALID_TEST_ACCOUNT_NUMBER_ARGUMENT_KEY) } } + + override fun beforeEach(context: ExtensionContext) {} }