From 38796aeb892379b8c2b7e4e1d7af00c4c050e8dc Mon Sep 17 00:00:00 2001 From: Fup Duck Date: Thu, 23 Nov 2017 11:34:52 +0100 Subject: Add Splash StartActivity * added Splash StartActivity to handle updates and initialization * created global Constants * renamed EIP Constants --- app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/src/test') diff --git a/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java b/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java index 833346fa..291d027e 100644 --- a/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java +++ b/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java @@ -42,9 +42,9 @@ public class GatewaysManagerTest { JSONObject secrets = new JSONObject(getJsonStringFor("secrets.json")); - when(sharedPreferences.getString(eq(Constants.PRIVATE_KEY), anyString())).thenReturn(secrets.getString(Constants.PRIVATE_KEY)); + when(sharedPreferences.getString(eq(EIPConstants.PRIVATE_KEY), anyString())).thenReturn(secrets.getString(EIPConstants.PRIVATE_KEY)); when(sharedPreferences.getString(eq(Provider.CA_CERT), anyString())).thenReturn(secrets.getString(Provider.CA_CERT)); - when(sharedPreferences.getString(eq(Constants.VPN_CERTIFICATE), anyString())).thenReturn(secrets.getString(Constants.VPN_CERTIFICATE)); + when(sharedPreferences.getString(eq(EIPConstants.VPN_CERTIFICATE), anyString())).thenReturn(secrets.getString(EIPConstants.VPN_CERTIFICATE)); when(mockContext.getSharedPreferences(anyString(), anyInt())).thenReturn(sharedPreferences); -- cgit v1.2.3 From da7293252f197e9b54c1abd8127b4abe45b95110 Mon Sep 17 00:00:00 2001 From: Fup Duck Date: Wed, 6 Dec 2017 01:58:21 +0100 Subject: move constants * move EIPConstants to Constants * unify EIPConstants where possible * create Updater --- app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/src/test') diff --git a/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java b/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java index 291d027e..01cd50dc 100644 --- a/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java +++ b/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java @@ -14,6 +14,7 @@ import org.mockito.junit.MockitoJUnitRunner; import java.io.IOException; +import se.leap.bitmaskclient.Constants; import se.leap.bitmaskclient.Provider; import se.leap.bitmaskclient.TestUtils; @@ -42,9 +43,9 @@ public class GatewaysManagerTest { JSONObject secrets = new JSONObject(getJsonStringFor("secrets.json")); - when(sharedPreferences.getString(eq(EIPConstants.PRIVATE_KEY), anyString())).thenReturn(secrets.getString(EIPConstants.PRIVATE_KEY)); + when(sharedPreferences.getString(eq(Constants.PRIVATE_KEY), anyString())).thenReturn(secrets.getString(Constants.PRIVATE_KEY)); when(sharedPreferences.getString(eq(Provider.CA_CERT), anyString())).thenReturn(secrets.getString(Provider.CA_CERT)); - when(sharedPreferences.getString(eq(EIPConstants.VPN_CERTIFICATE), anyString())).thenReturn(secrets.getString(EIPConstants.VPN_CERTIFICATE)); + when(sharedPreferences.getString(eq(Constants.VPN_CERTIFICATE), anyString())).thenReturn(secrets.getString(Constants.VPN_CERTIFICATE)); when(mockContext.getSharedPreferences(anyString(), anyInt())).thenReturn(sharedPreferences); -- cgit v1.2.3 From f8c2f76971f5a7f26d18e5e669d5e0ce9c560f3f Mon Sep 17 00:00:00 2001 From: Fup Duck Date: Thu, 7 Dec 2017 12:52:29 +0100 Subject: Rename constants * renamed last constants * remove unnecessary updates/ConstantUnification --- .../test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java | 4 ++-- .../java/se/leap/bitmaskclient/eip/VpnConfigGeneratorTest.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'app/src/test') diff --git a/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java b/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java index 01cd50dc..ea212480 100644 --- a/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java +++ b/app/src/test/java/se/leap/bitmaskclient/eip/GatewaysManagerTest.java @@ -43,9 +43,9 @@ public class GatewaysManagerTest { JSONObject secrets = new JSONObject(getJsonStringFor("secrets.json")); - when(sharedPreferences.getString(eq(Constants.PRIVATE_KEY), anyString())).thenReturn(secrets.getString(Constants.PRIVATE_KEY)); + when(sharedPreferences.getString(eq(Constants.PROVIDER_PRIVATE_KEY), anyString())).thenReturn(secrets.getString(Constants.PROVIDER_PRIVATE_KEY)); when(sharedPreferences.getString(eq(Provider.CA_CERT), anyString())).thenReturn(secrets.getString(Provider.CA_CERT)); - when(sharedPreferences.getString(eq(Constants.VPN_CERTIFICATE), anyString())).thenReturn(secrets.getString(Constants.VPN_CERTIFICATE)); + when(sharedPreferences.getString(eq(Constants.PROVIDER_VPN_CERTIFICATE), anyString())).thenReturn(secrets.getString(Constants.PROVIDER_VPN_CERTIFICATE)); when(mockContext.getSharedPreferences(anyString(), anyInt())).thenReturn(sharedPreferences); diff --git a/app/src/test/java/se/leap/bitmaskclient/eip/VpnConfigGeneratorTest.java b/app/src/test/java/se/leap/bitmaskclient/eip/VpnConfigGeneratorTest.java index 7e60edb9..25aba956 100644 --- a/app/src/test/java/se/leap/bitmaskclient/eip/VpnConfigGeneratorTest.java +++ b/app/src/test/java/se/leap/bitmaskclient/eip/VpnConfigGeneratorTest.java @@ -62,7 +62,7 @@ public class VpnConfigGeneratorTest { "\n" + "\n" + "\n" + - "-----BEGIN RSA PRIVATE KEY-----\n" + + "-----BEGIN RSA PRIVATE PROVIDER_KEY-----\n" + "MIIEwAIBADANBgkqhkiG9w0BAQEFAASCBKowggSmAgEAAoIBAQDUTYWeGgsHS+fjijmziniNqw6h\n" + "MBpyK4S/cM6PxV28C33VuOWPTMcIYesctjZANWFCggfFTQSjV5Qaxq9UK4i27tayLbCdlVS6hpbl\n" + "Vf4DuI3Gj1Pv1rtITBShtvCf3T7yBnjW4wVpOpsUAAOViKUSvUU3kPPMFWhiGQw8yHYr82ts6XMo\n" + @@ -85,7 +85,7 @@ public class VpnConfigGeneratorTest { "ispy6Y0CgYEAgl1o2lo+ACyk+oVQPaaPqK3d7WOBFp4eR2nXFor/vsx9igQOlZUgzRDQsR8jo1o9\n" + "efOSBf87igrZGgssys89pWa2dnXnz5PMmzkKr6bw4D9Ez6u6Puc9UZhGw/8wDYg6fSosdB9utspm\n" + "M698ycef7jBNMDgmhpSvfw5GctoNQ4s=\n" + - "-----END RSA PRIVATE KEY-----\n" + + "-----END RSA PRIVATE PROVIDER_KEY-----\n" + "\n" + "\n" + "-----BEGIN CERTIFICATE-----\n" + @@ -160,7 +160,7 @@ public class VpnConfigGeneratorTest { "\n" + "\n" + "\n" + - "-----BEGIN RSA PRIVATE KEY-----\n" + + "-----BEGIN RSA PRIVATE PROVIDER_KEY-----\n" + "MIIEwAIBADANBgkqhkiG9w0BAQEFAASCBKowggSmAgEAAoIBAQDUTYWeGgsHS+fjijmziniNqw6h\n" + "MBpyK4S/cM6PxV28C33VuOWPTMcIYesctjZANWFCggfFTQSjV5Qaxq9UK4i27tayLbCdlVS6hpbl\n" + "Vf4DuI3Gj1Pv1rtITBShtvCf3T7yBnjW4wVpOpsUAAOViKUSvUU3kPPMFWhiGQw8yHYr82ts6XMo\n" + @@ -183,7 +183,7 @@ public class VpnConfigGeneratorTest { "ispy6Y0CgYEAgl1o2lo+ACyk+oVQPaaPqK3d7WOBFp4eR2nXFor/vsx9igQOlZUgzRDQsR8jo1o9\n" + "efOSBf87igrZGgssys89pWa2dnXnz5PMmzkKr6bw4D9Ez6u6Puc9UZhGw/8wDYg6fSosdB9utspm\n" + "M698ycef7jBNMDgmhpSvfw5GctoNQ4s=\n" + - "-----END RSA PRIVATE KEY-----\n" + + "-----END RSA PRIVATE PROVIDER_KEY-----\n" + "\n" + "\n" + "-----BEGIN CERTIFICATE-----\n" + -- cgit v1.2.3 From b99938b1dc32f70800363f0faba88e7fd771abb4 Mon Sep 17 00:00:00 2001 From: Fup Duck Date: Thu, 7 Dec 2017 15:27:30 +0100 Subject: Undo renaming of KEY to PROVIDER_KEY * undo unwanted changes --- .../java/se/leap/bitmaskclient/eip/VpnConfigGeneratorTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/src/test') diff --git a/app/src/test/java/se/leap/bitmaskclient/eip/VpnConfigGeneratorTest.java b/app/src/test/java/se/leap/bitmaskclient/eip/VpnConfigGeneratorTest.java index 25aba956..7e60edb9 100644 --- a/app/src/test/java/se/leap/bitmaskclient/eip/VpnConfigGeneratorTest.java +++ b/app/src/test/java/se/leap/bitmaskclient/eip/VpnConfigGeneratorTest.java @@ -62,7 +62,7 @@ public class VpnConfigGeneratorTest { "\n" + "\n" + "\n" + - "-----BEGIN RSA PRIVATE PROVIDER_KEY-----\n" + + "-----BEGIN RSA PRIVATE KEY-----\n" + "MIIEwAIBADANBgkqhkiG9w0BAQEFAASCBKowggSmAgEAAoIBAQDUTYWeGgsHS+fjijmziniNqw6h\n" + "MBpyK4S/cM6PxV28C33VuOWPTMcIYesctjZANWFCggfFTQSjV5Qaxq9UK4i27tayLbCdlVS6hpbl\n" + "Vf4DuI3Gj1Pv1rtITBShtvCf3T7yBnjW4wVpOpsUAAOViKUSvUU3kPPMFWhiGQw8yHYr82ts6XMo\n" + @@ -85,7 +85,7 @@ public class VpnConfigGeneratorTest { "ispy6Y0CgYEAgl1o2lo+ACyk+oVQPaaPqK3d7WOBFp4eR2nXFor/vsx9igQOlZUgzRDQsR8jo1o9\n" + "efOSBf87igrZGgssys89pWa2dnXnz5PMmzkKr6bw4D9Ez6u6Puc9UZhGw/8wDYg6fSosdB9utspm\n" + "M698ycef7jBNMDgmhpSvfw5GctoNQ4s=\n" + - "-----END RSA PRIVATE PROVIDER_KEY-----\n" + + "-----END RSA PRIVATE KEY-----\n" + "\n" + "\n" + "-----BEGIN CERTIFICATE-----\n" + @@ -160,7 +160,7 @@ public class VpnConfigGeneratorTest { "\n" + "\n" + "\n" + - "-----BEGIN RSA PRIVATE PROVIDER_KEY-----\n" + + "-----BEGIN RSA PRIVATE KEY-----\n" + "MIIEwAIBADANBgkqhkiG9w0BAQEFAASCBKowggSmAgEAAoIBAQDUTYWeGgsHS+fjijmziniNqw6h\n" + "MBpyK4S/cM6PxV28C33VuOWPTMcIYesctjZANWFCggfFTQSjV5Qaxq9UK4i27tayLbCdlVS6hpbl\n" + "Vf4DuI3Gj1Pv1rtITBShtvCf3T7yBnjW4wVpOpsUAAOViKUSvUU3kPPMFWhiGQw8yHYr82ts6XMo\n" + @@ -183,7 +183,7 @@ public class VpnConfigGeneratorTest { "ispy6Y0CgYEAgl1o2lo+ACyk+oVQPaaPqK3d7WOBFp4eR2nXFor/vsx9igQOlZUgzRDQsR8jo1o9\n" + "efOSBf87igrZGgssys89pWa2dnXnz5PMmzkKr6bw4D9Ez6u6Puc9UZhGw/8wDYg6fSosdB9utspm\n" + "M698ycef7jBNMDgmhpSvfw5GctoNQ4s=\n" + - "-----END RSA PRIVATE PROVIDER_KEY-----\n" + + "-----END RSA PRIVATE KEY-----\n" + "\n" + "\n" + "-----BEGIN CERTIFICATE-----\n" + -- cgit v1.2.3 From 4f536f457da8bb7ab0316f6de7703437ad0ce58f Mon Sep 17 00:00:00 2001 From: Fup Duck Date: Tue, 16 Jan 2018 17:41:47 +0100 Subject: resolve commented issues * recreate activity correctly after changing orientation * replace getApplicationActivity --- app/src/test/java/se/leap/bitmaskclient/eip/ProviderApiManagerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/src/test') diff --git a/app/src/test/java/se/leap/bitmaskclient/eip/ProviderApiManagerTest.java b/app/src/test/java/se/leap/bitmaskclient/eip/ProviderApiManagerTest.java index 9ca90b17..f04ec0eb 100644 --- a/app/src/test/java/se/leap/bitmaskclient/eip/ProviderApiManagerTest.java +++ b/app/src/test/java/se/leap/bitmaskclient/eip/ProviderApiManagerTest.java @@ -86,7 +86,7 @@ public class ProviderApiManagerTest { } @Override - public void broadcastProgress(Intent intent) { + public void broadcastEvent(Intent intent) { //assertEquals("expected intent: ", expectedIntent, intent); } } -- cgit v1.2.3