aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/cgeo/geocaching/connector
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2014-06-11 20:17:43 +0200
committerBananeweizen <bananeweizen@gmx.de>2014-06-11 20:17:43 +0200
commit1e1ecc4c9514fbb2eb6fe273968ec9b57aa8f614 (patch)
treecab6a91076bb42aac6f037b24ea789939e3e1bb5 /tests/src/cgeo/geocaching/connector
parente9283b50b4d3e15dffefe8a9b9eda7de5b7999e5 (diff)
downloadcgeo-1e1ecc4c9514fbb2eb6fe273968ec9b57aa8f614.zip
cgeo-1e1ecc4c9514fbb2eb6fe273968ec9b57aa8f614.tar.gz
cgeo-1e1ecc4c9514fbb2eb6fe273968ec9b57aa8f614.tar.bz2
refactoring: more assertj instead of junit assert
Diffstat (limited to 'tests/src/cgeo/geocaching/connector')
-rw-r--r--tests/src/cgeo/geocaching/connector/gc/GCConstantsTest.java10
-rw-r--r--tests/src/cgeo/geocaching/connector/gc/TrackablesTest.java4
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/src/cgeo/geocaching/connector/gc/GCConstantsTest.java b/tests/src/cgeo/geocaching/connector/gc/GCConstantsTest.java
index be0c4da..ef50709 100644
--- a/tests/src/cgeo/geocaching/connector/gc/GCConstantsTest.java
+++ b/tests/src/cgeo/geocaching/connector/gc/GCConstantsTest.java
@@ -16,9 +16,9 @@ public class GCConstantsTest extends AndroidTestCase {
public static void testLocation() {
// GC37GFJ
- assertEquals("Bretagne, France", parseLocation(" <span id=\"ctl00_ContentBody_Location\">In Bretagne, France</span><br />"));
+ assertThat(parseLocation(" <span id=\"ctl00_ContentBody_Location\">In Bretagne, France</span><br />")).isEqualTo("Bretagne, France");
// GCV2R9
- assertEquals("California, United States", parseLocation("<span id=\"ctl00_ContentBody_Location\">In <a href=\"/map/beta/default.aspx?lat=37.4354&lng=-122.07745&z=16\" title=\"View Map\">California, United States</a></span><br />"));
+ assertThat(parseLocation("<span id=\"ctl00_ContentBody_Location\">In <a href=\"/map/beta/default.aspx?lat=37.4354&lng=-122.07745&z=16\" title=\"View Map\">California, United States</a></span><br />")).isEqualTo("California, United States");
}
private static String parseLocation(final String html) {
@@ -55,16 +55,16 @@ public class GCConstantsTest extends AndroidTestCase {
public static void testConstants() {
final String session = "userSession = new Groundspeak.Map.UserSession('aKWZ', userOptions:'XPTf', sessionToken:'123pNKwdktYGZL0xd-I7yqA6nm_JE1BDUtM4KcOkifin2TRCMutBd_PZE14Ohpffs2ZgkTnxTSnxYpBigK4hBA2', subscriberType: 3, enablePersonalization: true });";
- assertEquals("aKWZ", TextUtils.getMatch(session, GCConstants.PATTERN_USERSESSION, ""));
+ assertThat(TextUtils.getMatch(session, GCConstants.PATTERN_USERSESSION, "")).isEqualTo("aKWZ");
assertThat(TextUtils.getMatch(session, GCConstants.PATTERN_SESSIONTOKEN, "").startsWith("123pNK")).isTrue();
}
public static void testTBWithSpecialChar() {
// Incidentally, the site incorrectly escapes the "&" into "&amp;"
final String page = "<span id=\"ctl00_ContentBody_lbHeading\">Schlauchen&amp;ravestorm</span>";
- assertEquals("Schlauchen&ravestorm", Html.fromHtml(TextUtils.getMatch(page, GCConstants.PATTERN_TRACKABLE_NAME, "")).toString());
+ assertThat(Html.fromHtml(TextUtils.getMatch(page, GCConstants.PATTERN_TRACKABLE_NAME, "")).toString()).isEqualTo("Schlauchen&ravestorm");
// Test with the current incorrect form as well
final String page2 = "<span id=\"ctl00_ContentBody_lbHeading\">Schlauchen&ravestorm</span>";
- assertEquals("Schlauchen&ravestorm", Html.fromHtml(TextUtils.getMatch(page2, GCConstants.PATTERN_TRACKABLE_NAME, "")).toString());
+ assertThat(Html.fromHtml(TextUtils.getMatch(page2, GCConstants.PATTERN_TRACKABLE_NAME, "")).toString()).isEqualTo("Schlauchen&ravestorm");
}
}
diff --git a/tests/src/cgeo/geocaching/connector/gc/TrackablesTest.java b/tests/src/cgeo/geocaching/connector/gc/TrackablesTest.java
index c45efd7..faaedbf 100644
--- a/tests/src/cgeo/geocaching/connector/gc/TrackablesTest.java
+++ b/tests/src/cgeo/geocaching/connector/gc/TrackablesTest.java
@@ -101,9 +101,9 @@ public class TrackablesTest extends AbstractResourceInstrumentationTestCase {
assertThat(goal).isNotNull();
assertThat(goal.startsWith("Bei meinem Besitzer auf der Couch")).isTrue();
assertThat(goal.endsWith("Geocachern zusammen fotografieren.")).isTrue();
- assertEquals("Der kleine Maulwurf in etwas gr&ouml;&szlig;er :-)", trackable.getDetails());
+ assertThat(trackable.getDetails()).isEqualTo("Der kleine Maulwurf in etwas gr&ouml;&szlig;er :-)");
assertThat(trackable.getGeocode()).isEqualTo("TB54VJJ");
- assertEquals("Nordrhein-Westfalen, Germany", trackable.getOrigin());
+ assertThat(trackable.getOrigin()).isEqualTo("Nordrhein-Westfalen, Germany");
assertThat(trackable.getOwner()).isEqualTo("Lineflyer");
// the icon url is manipulated during compression
assertThat(trackable.getIconUrl().endsWith("www.geocaching.com/images/wpttypes/21.gif")).isTrue();