public void testSearchTrackable() throws Exception { final List<Trackable> trackables = GeokretyParser.parse(new InputSource(getResourceStream(R.raw.geokret141_xml))); assertThat(trackables).hasSize(2); final Trackable trackable1 = trackables.get(0); final Trackable trackable2 = trackables.get(1); assertThat(GeokretyConnector.searchTrackable("GKB580")) .isEqualToComparingFieldByField(trackable1); assertThat(GeokretyConnector.searchTrackable("GKB581")) .isEqualToComparingFieldByField(trackable2); }
@Override public LogResult postLog( final Geocache cache, final TrackableLog trackableLog, final Calendar date, final String log) { try { final ImmutablePair<StatusCode, List<String>> response = GeokretyConnector.postLogTrackable(getContext(), cache, trackableLog, date, log); final String logs = (response.getRight().isEmpty() ? "" : StringUtils.join(response.getRight(), "\n")); return new LogResult(response.getLeft(), logs); } catch (final Exception e) { Log.e("GeokretyLoggingManager.postLog", e); } return new LogResult(StatusCode.LOG_POST_ERROR, ""); }
public static void testGetId() throws Exception { assertThat(GeokretyConnector.getId("GKB581")).isEqualTo(46465); }
public static void testGeocode() throws Exception { assertThat(GeokretyConnector.geocode(46464)).isEqualTo("GKB580"); }