aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/connector/ec
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/cgeo/geocaching/connector/ec')
-rw-r--r--tests/src/cgeo/geocaching/connector/ec/ECApiTest.java5
-rw-r--r--tests/src/cgeo/geocaching/connector/ec/ECConnectorTest.java14
2 files changed, 11 insertions, 8 deletions
diff --git a/tests/src/cgeo/geocaching/connector/ec/ECApiTest.java b/tests/src/cgeo/geocaching/connector/ec/ECApiTest.java
index 9f9e99c..6525d22 100644
--- a/tests/src/cgeo/geocaching/connector/ec/ECApiTest.java
+++ b/tests/src/cgeo/geocaching/connector/ec/ECApiTest.java
@@ -1,12 +1,13 @@
package cgeo.geocaching.connector.ec;
+import static org.assertj.core.api.Assertions.assertThat;
import junit.framework.TestCase;
public class ECApiTest extends TestCase {
public static void testGetIdFromGeocode() throws Exception {
- assertEquals("242", ECApi.getIdFromGeocode("EC242"));
- assertEquals("242", ECApi.getIdFromGeocode("ec242"));
+ assertThat(ECApi.getIdFromGeocode("EC242")).isEqualTo("242");
+ assertThat(ECApi.getIdFromGeocode("ec242")).isEqualTo("242");
}
}
diff --git a/tests/src/cgeo/geocaching/connector/ec/ECConnectorTest.java b/tests/src/cgeo/geocaching/connector/ec/ECConnectorTest.java
index 4b9ae37..aa6a185 100644
--- a/tests/src/cgeo/geocaching/connector/ec/ECConnectorTest.java
+++ b/tests/src/cgeo/geocaching/connector/ec/ECConnectorTest.java
@@ -1,5 +1,7 @@
package cgeo.geocaching.connector.ec;
+import static org.assertj.core.api.Assertions.assertThat;
+
import cgeo.geocaching.Geocache;
import cgeo.geocaching.enumerations.CacheType;
import cgeo.geocaching.enumerations.LogType;
@@ -11,16 +13,16 @@ import junit.framework.TestCase;
public class ECConnectorTest extends TestCase {
public static void testCanHandle() throws Exception {
- assertTrue(ECConnector.getInstance().canHandle("EC380"));
- assertFalse(ECConnector.getInstance().canHandle("GC380"));
- assertFalse("faked EC codes must be handled during the import, otherwise GCECxxxx codes belong to 2 connectors", ECConnector.getInstance().canHandle("GCEC380"));
+ assertThat(ECConnector.getInstance().canHandle("EC380")).isTrue();
+ assertThat(ECConnector.getInstance().canHandle("GC380")).isFalse();
+ assertThat(ECConnector.getInstance().canHandle("GCEC380")).overridingErrorMessage("faked EC codes must be handled during the import, otherwise GCECxxxx codes belong to 2 connectors").isFalse();
}
public static void testGetPossibleLogTypes() throws Exception {
final List<LogType> possibleLogTypes = ECConnector.getInstance().getPossibleLogTypes(createCache());
- assertNotNull(possibleLogTypes);
- assertFalse(possibleLogTypes.isEmpty());
- assertTrue(possibleLogTypes.contains(LogType.FOUND_IT));
+ assertThat(possibleLogTypes).isNotNull();
+ assertThat(possibleLogTypes).isNotEmpty();
+ assertThat(possibleLogTypes).contains(LogType.FOUND_IT);
}
private static Geocache createCache() {