diff options
author | Samuel Tardieu <sam@rfc1149.net> | 2014-09-01 08:45:00 +0200 |
---|---|---|
committer | Samuel Tardieu <sam@rfc1149.net> | 2014-09-01 08:45:06 +0200 |
commit | 256703b84f7f565843e80e1517205ea7a89ce76f (patch) | |
tree | d2fd861462cfe00c8c087e516653fbb5dad772f4 /tests/src/cgeo/geocaching/connector | |
parent | b7f76b56547fe97af5fecb49f751a91d75a64ff1 (diff) | |
download | cgeo-256703b84f7f565843e80e1517205ea7a89ce76f.zip cgeo-256703b84f7f565843e80e1517205ea7a89ce76f.tar.gz cgeo-256703b84f7f565843e80e1517205ea7a89ce76f.tar.bz2 |
Adapt tests to change in trackable image size (x2)
Also cleanup the test code to use AssertJ assertions.
Diffstat (limited to 'tests/src/cgeo/geocaching/connector')
-rw-r--r-- | tests/src/cgeo/geocaching/connector/gc/TrackablesTest.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/src/cgeo/geocaching/connector/gc/TrackablesTest.java b/tests/src/cgeo/geocaching/connector/gc/TrackablesTest.java index faaedbf..89eada3 100644 --- a/tests/src/cgeo/geocaching/connector/gc/TrackablesTest.java +++ b/tests/src/cgeo/geocaching/connector/gc/TrackablesTest.java @@ -69,9 +69,9 @@ public class TrackablesTest extends AbstractResourceInstrumentationTestCase { assertThat(trackable).isNotNull(); assertThat(trackable.getName()).isEqualTo("The Brickster"); assertThat(trackable.getOwner()).isEqualTo("Adrian C"); - assertThat(trackable.getGoal().startsWith("I'm on the run from the law.")).isTrue(); - assertThat(trackable.getGoal().endsWith("what I've seen.")).isTrue(); - assertThat(trackable.getDistance() >= 11663.5f).isTrue(); + assertThat(trackable.getGoal()).startsWith("I'm on the run from the law."); + assertThat(trackable.getGoal()).endsWith("what I've seen."); + assertThat(trackable.getDistance()).isGreaterThanOrEqualTo(11663.5f); // the next two items are normally available for trackables, but not for this one, so explicitly test for null assertThat(trackable.getReleased()).isNull(); assertThat(trackable.getOrigin()).isNull(); @@ -83,8 +83,8 @@ public class TrackablesTest extends AbstractResourceInstrumentationTestCase { assertThat(trackable.getName()).isEqualTo("The Golden Lisa"); final String goal = trackable.getGoal(); assertThat(goal).isNotNull(); - assertThat(goal.contains("..")).isFalse(); - assertThat(goal.contains("href=\"http://www.geocaching.com/seek/cache_details.aspx?wp=GC3B7PD#\"")).isTrue(); + assertThat(goal).doesNotContain(".."); + assertThat(goal).contains("href=\"http://www.geocaching.com/seek/cache_details.aspx?wp=GC3B7PD#\""); } public void testParseSpeedManagerCompressedTrackable() { @@ -99,15 +99,15 @@ public class TrackablesTest extends AbstractResourceInstrumentationTestCase { assertThat(trackable.getName()).isEqualTo("Krtek - Der kleine Maulwurf"); final String goal = trackable.getGoal(); assertThat(goal).isNotNull(); - assertThat(goal.startsWith("Bei meinem Besitzer auf der Couch")).isTrue(); - assertThat(goal.endsWith("Geocachern zusammen fotografieren.")).isTrue(); + assertThat(goal).startsWith("Bei meinem Besitzer auf der Couch"); + assertThat(goal).endsWith("Geocachern zusammen fotografieren."); assertThat(trackable.getDetails()).isEqualTo("Der kleine Maulwurf in etwas größer :-)"); assertThat(trackable.getGeocode()).isEqualTo("TB54VJJ"); 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(); - assertThat(trackable.getImage().endsWith("img.geocaching.com/track/display/d9a475fa-da90-43ec-aec0-92afe26163e1.jpg")).isTrue(); + assertThat(trackable.getIconUrl()).endsWith("www.geocaching.com/images/wpttypes/21.gif"); + assertThat(trackable.getImage()).endsWith("img.geocaching.com/track/large/d9a475fa-da90-43ec-aec0-92afe26163e1.jpg"); assertThat(trackable.getOwnerGuid()).isEqualTo("d11a3e3d-7db0-4d43-87f2-7893238844a6"); assertThat(trackable.getSpottedGuid()).isNull(); assertThat(trackable.getSpottedType()).isEqualTo(Trackable.SPOTTED_OWNER); @@ -128,7 +128,7 @@ public class TrackablesTest extends AbstractResourceInstrumentationTestCase { assertThat(trackable).isNotNull(); final List<LogEntry> logs = trackable.getLogs(); assertThat(logs).isNotNull(); - assertThat(logs.isEmpty()).isFalse(); + assertThat(logs).isNotEmpty(); final LogEntry marked = logs.get(0); assertThat(marked.type).isEqualTo(LogType.MARKED_MISSING); } |