fix test post rebase

This commit is contained in:
Valere 2022-05-27 10:17:40 +02:00
parent 5735b094ac
commit c8b44bfd4c
1 changed files with 3 additions and 9 deletions

View File

@ -28,8 +28,7 @@ import org.junit.runners.JUnit4
import org.junit.runners.MethodSorters import org.junit.runners.MethodSorters
import org.matrix.android.sdk.InstrumentedTest import org.matrix.android.sdk.InstrumentedTest
import org.matrix.android.sdk.api.session.crypto.MXCryptoError import org.matrix.android.sdk.api.session.crypto.MXCryptoError
import org.matrix.android.sdk.common.CommonTestHelper import org.matrix.android.sdk.common.CommonTestHelper.Companion.runCryptoTest
import org.matrix.android.sdk.common.CryptoTestHelper
@RunWith(JUnit4::class) @RunWith(JUnit4::class)
@FixMethodOrder(MethodSorters.JVM) @FixMethodOrder(MethodSorters.JVM)
@ -37,9 +36,7 @@ import org.matrix.android.sdk.common.CryptoTestHelper
class ReplayAttackTest : InstrumentedTest { class ReplayAttackTest : InstrumentedTest {
@Test @Test
fun replayAttackAlreadyDecryptedEventTest() { fun replayAttackAlreadyDecryptedEventTest() = runCryptoTest(context()) { cryptoTestHelper, testHelper ->
val testHelper = CommonTestHelper(context())
val cryptoTestHelper = CryptoTestHelper(testHelper)
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom(true) val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom(true)
val e2eRoomID = cryptoTestData.roomId val e2eRoomID = cryptoTestData.roomId
@ -77,9 +74,7 @@ class ReplayAttackTest : InstrumentedTest {
} }
@Test @Test
fun replayAttackSameEventTest() { fun replayAttackSameEventTest() = runCryptoTest(context()) { cryptoTestHelper, testHelper ->
val testHelper = CommonTestHelper(context())
val cryptoTestHelper = CryptoTestHelper(testHelper)
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom(true) val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoom(true)
val e2eRoomID = cryptoTestData.roomId val e2eRoomID = cryptoTestData.roomId
@ -110,6 +105,5 @@ class ReplayAttackTest : InstrumentedTest {
fail("Shouldn't throw a decryption error for same event") fail("Shouldn't throw a decryption error for same event")
} }
} }
cryptoTestData.cleanUp(testHelper)
} }
} }