@Test public void testGetSegmentById() throws Exception { mockServer.expect(requestTo("https: .andExpect(header("Authorization", "Bearer ACCESS_TOKEN")) .andRespond(withSuccess(new ClassPathResource("segment.json", getClass()), MediaType.APPLICATION_JSON)); StravaSegment segment = strava.segmentOperations().getSegmentById("1234"); assertEquals(229781, segment.getId()); assertEquals("Hawk Hill", segment.getName()); assertEquals("Ride", segment.getActivityType()); assertEquals(2684.82, segment.getDistance(), .1); assertEquals("}g|e...VJr@", segment.getMap().getPolyline()); }
public StravaSegment getSegmentById(String id) { return restTemplate.getForObject(buildUri("/segments/" + id), StravaSegment.class); }
SegmentTemplate extends AbstractStravaOperations implements SegmentOperations { public StravaSegment getSegmentById(String id) { return restTemplate.getForObject(buildUri("/segments/" + id), StravaSegment.class); } }
SegmentTemplate extends AbstractStravaOperations implements SegmentOperations { public StravaSegment getSegmentById(String id) { return restTemplate.getForObject(buildUri("/segments/" + id), StravaSegment.class); } SegmentTemplate(RestTemplate restTemplate, boolean isAuthorizedForUser); }
SegmentTemplate extends AbstractStravaOperations implements SegmentOperations { public StravaSegment getSegmentById(String id) { return restTemplate.getForObject(buildUri("/segments/" + id), StravaSegment.class); } SegmentTemplate(RestTemplate restTemplate, boolean isAuthorizedForUser); StravaSegment getSegmentById(String id); }
SegmentTemplate extends AbstractStravaOperations implements SegmentOperations { public StravaSegment getSegmentById(String id) { return restTemplate.getForObject(buildUri("/segments/" + id), StravaSegment.class); } SegmentTemplate(RestTemplate restTemplate, boolean isAuthorizedForUser); StravaSegment getSegmentById(String id);  }