From 61789a24a8743cab5525545366ecac958436db19 Mon Sep 17 00:00:00 2001 From: Nils Behlen Date: Thu, 27 Feb 2020 10:54:13 +0100 Subject: [PATCH] fix test to expect exception --- app/src/test/java/it/netknights/piauthenticator/TestUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/test/java/it/netknights/piauthenticator/TestUtil.java b/app/src/test/java/it/netknights/piauthenticator/TestUtil.java index ff063a9..169e6ae 100644 --- a/app/src/test/java/it/netknights/piauthenticator/TestUtil.java +++ b/app/src/test/java/it/netknights/piauthenticator/TestUtil.java @@ -215,7 +215,7 @@ public void removePublicKey() throws IOException { assertFalse(test.exists()); } - @Test + @Test(expected = org.json.JSONException.class) public void saveLoadDeleteFirebaseConfig() throws GeneralSecurityException, JSONException, IOException { // there is none assertNull(util.loadFirebaseConfig()); @@ -223,7 +223,7 @@ public void saveLoadDeleteFirebaseConfig() throws GeneralSecurityException, JSON // This throws exception -> returns null FirebaseInitConfig fbConf = new FirebaseInitConfig(null, null, null, null); util.storeFirebaseConfig(fbConf); - assertNull(util.loadFirebaseConfig()); + util.loadFirebaseConfig(); // this will throw an exception when evaluating the loaded JSON // this should work fbConf = new FirebaseInitConfig("projID", "appID", "api_key", "projNumber");