From c8b44bfd4cbf11fe0cd7cffadd28f6f5f537e423 Mon Sep 17 00:00:00 2001 From: Valere Date: Fri, 27 May 2022 10:17:40 +0200 Subject: [PATCH] fix test post rebase --- .../internal/crypto/replayattack/ReplayAttackTest.kt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/replayattack/ReplayAttackTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/replayattack/ReplayAttackTest.kt index 09c340a14f..53cf802b91 100644 --- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/replayattack/ReplayAttackTest.kt +++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/replayattack/ReplayAttackTest.kt @@ -28,8 +28,7 @@ import org.junit.runners.JUnit4 import org.junit.runners.MethodSorters import org.matrix.android.sdk.InstrumentedTest import org.matrix.android.sdk.api.session.crypto.MXCryptoError -import org.matrix.android.sdk.common.CommonTestHelper -import org.matrix.android.sdk.common.CryptoTestHelper +import org.matrix.android.sdk.common.CommonTestHelper.Companion.runCryptoTest @RunWith(JUnit4::class) @FixMethodOrder(MethodSorters.JVM) @@ -37,9 +36,7 @@ import org.matrix.android.sdk.common.CryptoTestHelper class ReplayAttackTest : InstrumentedTest { @Test - fun replayAttackAlreadyDecryptedEventTest() { - val testHelper = CommonTestHelper(context()) - val cryptoTestHelper = CryptoTestHelper(testHelper) + fun replayAttackAlreadyDecryptedEventTest() = runCryptoTest(context()) { cryptoTestHelper, testHelper -> val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom(true) val e2eRoomID = cryptoTestData.roomId @@ -77,9 +74,7 @@ class ReplayAttackTest : InstrumentedTest { } @Test - fun replayAttackSameEventTest() { - val testHelper = CommonTestHelper(context()) - val cryptoTestHelper = CryptoTestHelper(testHelper) + fun replayAttackSameEventTest() = runCryptoTest(context()) { cryptoTestHelper, testHelper -> val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom(true) val e2eRoomID = cryptoTestData.roomId @@ -110,6 +105,5 @@ class ReplayAttackTest : InstrumentedTest { fail("Shouldn't throw a decryption error for same event") } } - cryptoTestData.cleanUp(testHelper) } }