summaryrefslogtreecommitdiff
path: root/app/src/androidTest/java/se
diff options
context:
space:
mode:
authorFup Duck <fupduck@sacknagel.com>2018-01-13 17:03:14 +0100
committerFup Duck <fupduck@sacknagel.com>2018-01-13 17:03:14 +0100
commit153e35707ed2854d89c61fdb9f82a6e9ec0db9cc (patch)
treee34a41e4ac95f7ad3ef8ffdb21da29c34310c03b /app/src/androidTest/java/se
parent8909b3e9ea63c8dc78abf89de69b44d3d172f763 (diff)
more static constant import and import cleanup
Diffstat (limited to 'app/src/androidTest/java/se')
-rw-r--r--app/src/androidTest/java/se/leap/bitmaskclient/test/TestEIP.java25
-rw-r--r--app/src/androidTest/java/se/leap/bitmaskclient/test/TestGatewaysManager.java5
2 files changed, 18 insertions, 12 deletions
diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/TestEIP.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/TestEIP.java
index fc763c7d..4c215360 100644
--- a/app/src/androidTest/java/se/leap/bitmaskclient/test/TestEIP.java
+++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/TestEIP.java
@@ -17,12 +17,17 @@
package se.leap.bitmaskclient.test;
-import android.content.*;
-import android.test.*;
-import android.test.suitebuilder.annotation.*;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.test.ServiceTestCase;
+import android.test.suitebuilder.annotation.MediumTest;
-import se.leap.bitmaskclient.*;
-import se.leap.bitmaskclient.eip.*;
+import se.leap.bitmaskclient.eip.EIP;
+
+import static se.leap.bitmaskclient.Constants.EIP_ACTION_CHECK_CERT_VALIDITY;
+import static se.leap.bitmaskclient.Constants.PROVIDER_VPN_CERTIFICATE;
+import static se.leap.bitmaskclient.Constants.SHARED_PREFERENCES;
/**
* @author parmegv
@@ -37,7 +42,7 @@ public class TestEIP extends ServiceTestCase<EIP> {
super(activityClass);
context = getSystemContext();
intent = new Intent(context, EIP.class);
- preferences = context.getSharedPreferences(Constants.SHARED_PREFERENCES, Context.MODE_PRIVATE);
+ preferences = context.getSharedPreferences(SHARED_PREFERENCES, Context.MODE_PRIVATE);
}
@Override
@@ -59,14 +64,14 @@ public class TestEIP extends ServiceTestCase<EIP> {
}
private void testEmptyCertificate() {
- preferences.edit().putString(Constants.PROVIDER_VPN_CERTIFICATE, "").apply();
- startService(Constants.EIP_ACTION_CHECK_CERT_VALIDITY);
+ preferences.edit().putString(PROVIDER_VPN_CERTIFICATE, "").apply();
+ startService(EIP_ACTION_CHECK_CERT_VALIDITY);
}
private void testExpiredCertificate() {
String expired_certificate = "expired certificate";
- preferences.edit().putString(Constants.PROVIDER_VPN_CERTIFICATE, expired_certificate).apply();
- startService(Constants.EIP_ACTION_CHECK_CERT_VALIDITY);
+ preferences.edit().putString(PROVIDER_VPN_CERTIFICATE, expired_certificate).apply();
+ startService(EIP_ACTION_CHECK_CERT_VALIDITY);
}
private void startService(String action) {
diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/TestGatewaysManager.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/TestGatewaysManager.java
index b8cc9715..02c521be 100644
--- a/app/src/androidTest/java/se/leap/bitmaskclient/test/TestGatewaysManager.java
+++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/TestGatewaysManager.java
@@ -25,9 +25,10 @@ import org.json.*;
import java.io.IOException;
import java.util.Arrays;
-import se.leap.bitmaskclient.Constants;
import se.leap.bitmaskclient.eip.*;
+import static se.leap.bitmaskclient.Constants.SHARED_PREFERENCES;
+
/**
* @author parmegv
*/
@@ -109,7 +110,7 @@ public class TestGatewaysManager extends InstrumentationTestCase {
private void mockGatewaysManager() {
context = getInstrumentation().getContext();
- preferences = context.getSharedPreferences(Constants.SHARED_PREFERENCES, Activity.MODE_PRIVATE);
+ preferences = context.getSharedPreferences(SHARED_PREFERENCES, Activity.MODE_PRIVATE);
gateways_manager = new GatewaysManager(context, preferences);
}