aboutsummaryrefslogtreecommitdiff
path: root/java/android
diff options
context:
space:
mode:
authorpedroGitt <pedro.contreiras@amdocs.com>2016-11-08 11:21:45 +0100
committerpedroGitt <pedro.contreiras@amdocs.com>2016-11-08 11:21:45 +0100
commit1fd908c72ab5227e7c9d8bfaaba7781ec1067aee (patch)
tree54e8d4fae96644411489930d11e1729c36fcaede /java/android
parentc144d3fec5f135319a6b46bc5645f7e70eecc1da (diff)
Light refactoring by using test helper methods getFingerprintKey() and getIdentityKey()
Diffstat (limited to 'java/android')
-rw-r--r--java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmAccountTest.java20
1 files changed, 4 insertions, 16 deletions
diff --git a/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmAccountTest.java b/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmAccountTest.java
index 7a6233d..dc47d51 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmAccountTest.java
+++ b/java/android/OlmLibSdk/olm-sdk/src/androidTest/java/org/matrix/olm/OlmAccountTest.java
@@ -132,24 +132,12 @@ public class OlmAccountTest {
Log.d(LOG_TAG,"## testIdentityKeys Keys="+identityKeysJson);
// is JSON_KEY_FINGER_PRINT_KEY present?
- try {
- String fingerPrintKey = identityKeysJson.getString(OlmAccount.JSON_KEY_FINGER_PRINT_KEY);
- assertTrue("fingerprint key missing",!TextUtils.isEmpty(fingerPrintKey));
- } catch (JSONException e) {
- e.printStackTrace();
- assertTrue("Exception MSg="+e.getMessage(), false);
- }
+ String fingerPrintKey = TestHelper.getFingerprintKey(identityKeysJson);
+ assertTrue("fingerprint key missing",!TextUtils.isEmpty(fingerPrintKey));
// is JSON_KEY_IDENTITY_KEY present?
- try {
- String identityKey = identityKeysJson.getString(OlmAccount.JSON_KEY_IDENTITY_KEY);
- assertTrue("identity key missing",!TextUtils.isEmpty(identityKey));
- } catch (JSONException e) {
- e.printStackTrace();
- assertTrue("Exception MSg="+e.getMessage(), false);
- }
-
-
+ String identityKey = TestHelper.getIdentityKey(identityKeysJson);
+ assertTrue("identity key missing",!TextUtils.isEmpty(identityKey));
}
//****************************************************