From 45a98c20a8f0018c80b18e6bb6e04b3a6be03732 Mon Sep 17 00:00:00 2001 From: ylecollen Date: Tue, 3 Jan 2017 16:41:04 +0100 Subject: EncryptMessage triggers an exception when it fails --- .../src/androidTest/java/org/matrix/olm/OlmGroupSessionTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'java/android/OlmLibSdk/olm-sdk/src/androidTest') diff --git a/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmGroupSessionTest.java b/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmGroupSessionTest.java index 111032e..0f0d779 100644 --- a/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmGroupSessionTest.java +++ b/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmGroupSessionTest.java @@ -113,7 +113,11 @@ public class OlmGroupSessionTest { @Test public void test05OutboundGroupEncryptMessage() { // alice encrypts a message to bob - mAliceToBobMessage = mAliceOutboundGroupSession.encryptMessage(CLEAR_MESSAGE1); + try { + mAliceToBobMessage = mAliceOutboundGroupSession.encryptMessage(CLEAR_MESSAGE1); + } catch (OlmOutboundGroupSession.EncryptMessageException e) { + assertTrue("Exception in bob encryptMessage, Exception code=" + e.getMessage(), false); + } assertFalse(TextUtils.isEmpty(mAliceToBobMessage)); // test message index after encryption is incremented -- cgit v1.2.3