From ee1580c50e0759442da6fc9686538309b065a85e Mon Sep 17 00:00:00 2001 From: valere Date: Thu, 6 Apr 2023 09:59:00 +0200 Subject: [PATCH] Fix failing test --- .../matrix/android/sdk/internal/crypto/PreShareKeysTest.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/matrix-sdk-android/src/androidTestKotlinCrypto/java/org/matrix/android/sdk/internal/crypto/PreShareKeysTest.kt b/matrix-sdk-android/src/androidTestKotlinCrypto/java/org/matrix/android/sdk/internal/crypto/PreShareKeysTest.kt index 6a24de07ae..5f677b3d25 100644 --- a/matrix-sdk-android/src/androidTestKotlinCrypto/java/org/matrix/android/sdk/internal/crypto/PreShareKeysTest.kt +++ b/matrix-sdk-android/src/androidTestKotlinCrypto/java/org/matrix/android/sdk/internal/crypto/PreShareKeysTest.kt @@ -49,7 +49,7 @@ class PreShareKeysTest : InstrumentedTest { val preShareCount = bobSession.cryptoService().keysBackupService().getTotalNumbersOfKeys() assertEquals("Bob should not have receive any key from alice at this point", 0, preShareCount) - Log.d("#Test", "Room Key Received from alice $preShareCount") + Log.d("#E2E", "Room Key Received from alice $preShareCount") // Force presharing of new outbound key aliceSession.cryptoService().prepareToEncrypt(e2eRoomID) @@ -78,7 +78,9 @@ class PreShareKeysTest : InstrumentedTest { assertEquals("The session received by bob should match what alice sent", 0, sharedIndex) // Just send a real message as test - val sentEvent = testHelper.sendTextMessage(aliceSession.getRoom(e2eRoomID)!!, "Allo", 1).first() + val sentEventId = testHelper.sendMessageInRoom(aliceSession.getRoom(e2eRoomID)!!, "Allo") + + val sentEvent = aliceSession.getRoom(e2eRoomID)!!.getTimelineEvent(sentEventId)!! assertEquals("Unexpected megolm session", megolmSessionId, sentEvent.root.content.toModel()?.sessionId) testHelper.retryPeriodically {