From 2a5b93d9c50e3623b4d147c3615e4389ce8d7bcf Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Sun, 24 Jun 2018 11:21:52 +0200 Subject: [PATCH] fix unit tests --- .../keychain/pgp/PgpEncryptDecryptTest.java | 8 ++------ .../sufficientlysecure/keychain/provider/InteropTest.java | 1 + 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpEncryptDecryptTest.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpEncryptDecryptTest.java index 943446728..0a6f03932 100644 --- a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpEncryptDecryptTest.java +++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/pgp/PgpEncryptDecryptTest.java @@ -831,9 +831,7 @@ public class PgpEncryptDecryptTest { { // decryption with passphrase cached should succeed for the other key if first is gone // delete first key from database - KeyWritableRepository.create(RuntimeEnvironment.application).getContentResolver().delete( - KeyRingData.buildPublicKeyRingUri(mStaticRing1.getMasterKeyId()), null, null - ); + KeyWritableRepository.create(RuntimeEnvironment.application).deleteKeyRing(mStaticRing1.getMasterKeyId()); ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayInputStream in = new ByteArrayInputStream(ciphertext); @@ -912,9 +910,7 @@ public class PgpEncryptDecryptTest { { // decryption with passphrase cached should succeed for the other key if first is gone // delete first key from database - KeyWritableRepository.create(RuntimeEnvironment.application).getContentResolver().delete( - KeyRingData.buildPublicKeyRingUri(mStaticRing1.getMasterKeyId()), null, null - ); + KeyWritableRepository.create(RuntimeEnvironment.application).deleteKeyRing(mStaticRing1.getMasterKeyId()); ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayInputStream in = new ByteArrayInputStream(ciphertext); diff --git a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/provider/InteropTest.java b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/provider/InteropTest.java index 6101b4a02..384f83949 100644 --- a/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/provider/InteropTest.java +++ b/OpenKeychain/src/test/java/org/sufficientlysecure/keychain/provider/InteropTest.java @@ -244,6 +244,7 @@ public class InteropTest { KeyRings.buildUnifiedKeyRingsFindBySubkeyUri(verify.getMasterKeyId()) : null; KeyWritableRepository helper = new KeyWritableRepository(RuntimeEnvironment.application, + new KeychainDatabase(RuntimeEnvironment.application), LocalPublicKeyStorage.getInstance(RuntimeEnvironment.application), LocalSecretKeyStorage.getInstance(RuntimeEnvironment.application), DatabaseNotifyManager.create(RuntimeEnvironment.application),