summaryrefslogtreecommitdiff
path: root/app/src/androidTest/java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/androidTest/java')
-rw-r--r--app/src/androidTest/java/se/leap/bitmaskclient/test/TestVpnCertificateValidator.java15
-rw-r--r--app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java2
2 files changed, 8 insertions, 9 deletions
diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/TestVpnCertificateValidator.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/TestVpnCertificateValidator.java
index 2704bcad..323e7e6d 100644
--- a/app/src/androidTest/java/se/leap/bitmaskclient/test/TestVpnCertificateValidator.java
+++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/TestVpnCertificateValidator.java
@@ -49,7 +49,6 @@ public class TestVpnCertificateValidator extends InstrumentationTestCase {
}
- //TODO: This test proves that the validation method is weird. Valid dates range between Nov. 2oo6 and Nov. 2017 instead of Nov. 2012 and Nov.2022
public void testIsValid() {
VpnCertificateValidator validator = new VpnCertificateValidator(certificate_valid_from_nov2012_to_nov2022);
Calendar calendar = Calendar.getInstance();
@@ -60,26 +59,26 @@ public class TestVpnCertificateValidator extends InstrumentationTestCase {
validator.setCalendarProvider(new TestCalendarProvider(calendar.getTimeInMillis()));
assertFalse(validator.isValid());
- calendar.set(Calendar.YEAR, 2010);
+ calendar.set(Calendar.YEAR, 2011);
calendar.set(Calendar.MONTH, Calendar.NOVEMBER);
calendar.set(Calendar.DAY_OF_MONTH, 6);
validator.setCalendarProvider(new TestCalendarProvider(calendar.getTimeInMillis()));
- assertTrue(validator.isValid());
+ assertFalse(validator.isValid());
- calendar.set(Calendar.YEAR, 2011);
+ calendar.set(Calendar.YEAR, 2012);
calendar.set(Calendar.MONTH, Calendar.NOVEMBER);
calendar.set(Calendar.DAY_OF_MONTH, 6);
validator.setCalendarProvider(new TestCalendarProvider(calendar.getTimeInMillis()));
assertTrue(validator.isValid());
- calendar.set(Calendar.YEAR, 2017);
- calendar.set(Calendar.MONTH, Calendar.NOVEMBER);
+ calendar.set(Calendar.YEAR, 2022);
+ calendar.set(Calendar.MONTH, Calendar.AUGUST);
calendar.set(Calendar.DAY_OF_MONTH, 5);
validator.setCalendarProvider(new TestCalendarProvider(calendar.getTimeInMillis()));
assertTrue(validator.isValid());
- calendar.set(Calendar.YEAR, 2017);
- calendar.set(Calendar.MONTH, Calendar.NOVEMBER);
+ calendar.set(Calendar.YEAR, 2022);
+ calendar.set(Calendar.MONTH, Calendar.AUGUST);
calendar.set(Calendar.DAY_OF_MONTH, 6);
validator.setCalendarProvider(new TestCalendarProvider(calendar.getTimeInMillis()));
assertFalse(validator.isValid());
diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java
index 9dcb4da1..b0996032 100644
--- a/app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java
+++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java
@@ -65,7 +65,7 @@ public class VpnTestController {
return iconShowsConnected();
}
};
- assertTrue("condition iconShowsConnected not fulfilled within " + max_seconds_until_connected * 1000 + " seconds." , solo.waitForCondition(condition, max_seconds_until_connected * 1000));
+ assertTrue("condition iconShowsConnected not fulfilled within " + max_seconds_until_connected + " seconds." , solo.waitForCondition(condition, max_seconds_until_connected * 1000));
sleepSeconds(2);
}