From 1e1ecc4c9514fbb2eb6fe273968ec9b57aa8f614 Mon Sep 17 00:00:00 2001 From: Bananeweizen Date: Wed, 11 Jun 2014 20:17:43 +0200 Subject: refactoring: more assertj instead of junit assert --- tests/src/cgeo/geocaching/connector/gc/GCConstantsTest.java | 10 +++++----- tests/src/cgeo/geocaching/connector/gc/TrackablesTest.java | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/src/cgeo/geocaching/connector') 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(" In Bretagne, France
")); + assertThat(parseLocation(" In Bretagne, France
")).isEqualTo("Bretagne, France"); // GCV2R9 - assertEquals("California, United States", parseLocation("In California, United States
")); + assertThat(parseLocation("In California, United States
")).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 "&" final String page = "Schlauchen&ravestorm"; - 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 = "Schlauchen&ravestorm"; - 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ößer :-)", trackable.getDetails()); + assertThat(trackable.getDetails()).isEqualTo("Der kleine Maulwurf in etwas größ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(); -- cgit v1.1