@Test public void testGetJourneyJson() throws Exception { stubFor(get(urlPathEqualTo("/api/journey.json")) .willReturn(aResponse() .withStatus(200) .withHeader("Content-Type", "text/json") .withBodyFile("journey-v1api.json"))); String journeyJson = apiClient.getJourneyJson("balanced", "mySetOfItineraryPoints", "2016-07-03 07:51:12", null, 24); verify(getRequestedFor(urlPathEqualTo("/api/journey.json")) .withQueryParam("plan", equalTo("balanced")) .withQueryParam("itinerarypoints", equalTo("mySetOfItineraryPoints")) .withQueryParam("leaving", equalTo("2016-07-03 07:51:12")) .withQueryParam("speed", equalTo("24")) .withQueryParam("key", equalTo("myApiKey"))); assertThat(journeyJson).isNotNull(); assertThat(journeyJson).contains("{"); }
public String getJourneyJson(final String plan, final String itineraryPoints, final String leaving, final String arriving, final int speed) throws IOException { Response<String> response = v1Api.getJourneyJson(plan, itineraryPoints, leaving, arriving, speed).execute(); return JourneyStringTransformerKt.fromV1ApiJson(response.body()); }
RetrofitApiClient { public String getJourneyJson(final String plan, final String itineraryPoints, final String leaving, final String arriving, final int speed) throws IOException { Response<String> response = v1Api.getJourneyJson(plan, itineraryPoints, leaving, arriving, speed).execute(); return JourneyStringTransformerKt.fromV1ApiJson(response.body()); } }
RetrofitApiClient { public String getJourneyJson(final String plan, final String itineraryPoints, final String leaving, final String arriving, final int speed) throws IOException { Response<String> response = v1Api.getJourneyJson(plan, itineraryPoints, leaving, arriving, speed).execute(); return JourneyStringTransformerKt.fromV1ApiJson(response.body()); } @SuppressWarnings("deprecation")  RetrofitApiClient(Builder builder); }
RetrofitApiClient { public String getJourneyJson(final String plan, final String itineraryPoints, final String leaving, final String arriving, final int speed) throws IOException { Response<String> response = v1Api.getJourneyJson(plan, itineraryPoints, leaving, arriving, speed).execute(); return JourneyStringTransformerKt.fromV1ApiJson(response.body()); } @SuppressWarnings("deprecation")  RetrofitApiClient(Builder builder); String getJourneyJson(final String plan,
                               final String itineraryPoints,
                               final String leaving,
                               final String arriving,
                               final int speed); String retrievePreviousJourneyJson(final String plan,
                                            final long itineraryId); Blog getBlogEntries(); POICategories getPOICategories(); List<POI> getPOIs(final String type,
                           final double lonW,
                           final double latS,
                           final double lonE,
                           final double latN); List<POI> getPOIs(final String type,
                           final double lon,
                           final double lat,
                           final int radius); GeoPlaces geoCoder(final String search,
                            final double lonW,
                            final double latS,
                            final double lonE,
                            final double latN); PhotomapCategories getPhotomapCategories(); Photos getPhotos(final double lonW,
                          final double latS,
                          final double lonE,
                          final double latN); Photos getPhoto(final long photoId); UserJourneys getUserJourneys(final String username); Result register(final String username,
                         final String password,
                         final String name,
                         final String email); Signin.Result authenticate(final String identifier,
                                    final String password); Result sendFeedback(final int itinerary,
                             final String comments,
                             final String name,
                             final String email); Upload.Result uploadPhoto(final String username,
                                   final String password,
                                   final double lon,
                                   final double lat,
                                   final long dateTime,
                                   final String category,
                                   final String metaCat,
                                   final String caption,
                                   final String filename); }
RetrofitApiClient { public String getJourneyJson(final String plan, final String itineraryPoints, final String leaving, final String arriving, final int speed) throws IOException { Response<String> response = v1Api.getJourneyJson(plan, itineraryPoints, leaving, arriving, speed).execute(); return JourneyStringTransformerKt.fromV1ApiJson(response.body()); } @SuppressWarnings("deprecation")  RetrofitApiClient(Builder builder); String getJourneyJson(final String plan,
                               final String itineraryPoints,
                               final String leaving,
                               final String arriving,
                               final int speed); String retrievePreviousJourneyJson(final String plan,
                                            final long itineraryId); Blog getBlogEntries(); POICategories getPOICategories(); List<POI> getPOIs(final String type,
                           final double lonW,
                           final double latS,
                           final double lonE,
                           final double latN); List<POI> getPOIs(final String type,
                           final double lon,
                           final double lat,
                           final int radius); GeoPlaces geoCoder(final String search,
                            final double lonW,
                            final double latS,
                            final double lonE,
                            final double latN); PhotomapCategories getPhotomapCategories(); Photos getPhotos(final double lonW,
                          final double latS,
                          final double lonE,
                          final double latN); Photos getPhoto(final long photoId); UserJourneys getUserJourneys(final String username); Result register(final String username,
                         final String password,
                         final String name,
                         final String email); Signin.Result authenticate(final String identifier,
                                    final String password); Result sendFeedback(final int itinerary,
                             final String comments,
                             final String name,
                             final String email); Upload.Result uploadPhoto(final String username,
                                   final String password,
                                   final double lon,
                                   final double lat,
                                   final long dateTime,
                                   final String category,
                                   final String metaCat,
                                   final String caption,
                                   final String filename);  }