@Test public void testGetSegmentEffortById() throws Exception { mockServer.expect(requestTo("https: .andExpect(header("Authorization", "Bearer ACCESS_TOKEN")) .andRespond(withSuccess(new ClassPathResource("segmentEffort.json", getClass()), MediaType.APPLICATION_JSON)); StravaSegmentEffort segmentEffort = strava.segmentEffortOperations().getSegmentEffortById("1234567"); assertEquals(188196580, segmentEffort.getId()); assertEquals("SF2G San Bruno Ave Climb", segmentEffort.getName()); assertEquals("5099", segmentEffort.getAthlete().getId()); assertEquals(236.82, segmentEffort.getDistance(), .1); assertEquals("2006-04-21T13:20:40Z", segmentEffort.getDate()); assertEquals(345781, segmentEffort.getSegment().getId()); assertEquals(62, segmentEffort.getElapsedTime()); }
public StravaSegmentEffort getSegmentEffortById(String id) { return restTemplate.getForObject(buildUri("/segment_efforts/" + id), StravaSegmentEffort.class); }
SegmentEffortTemplate extends AbstractStravaOperations implements SegmentEffortOperations { public StravaSegmentEffort getSegmentEffortById(String id) { return restTemplate.getForObject(buildUri("/segment_efforts/" + id), StravaSegmentEffort.class); } }
SegmentEffortTemplate extends AbstractStravaOperations implements SegmentEffortOperations { public StravaSegmentEffort getSegmentEffortById(String id) { return restTemplate.getForObject(buildUri("/segment_efforts/" + id), StravaSegmentEffort.class); } SegmentEffortTemplate(RestTemplate restTemplate, boolean isAuthorizedForUser); }
SegmentEffortTemplate extends AbstractStravaOperations implements SegmentEffortOperations { public StravaSegmentEffort getSegmentEffortById(String id) { return restTemplate.getForObject(buildUri("/segment_efforts/" + id), StravaSegmentEffort.class); } SegmentEffortTemplate(RestTemplate restTemplate, boolean isAuthorizedForUser); List<StravaSegmentEffort> getSegmentEfforts(String segmentId, String athleteId); StravaSegmentEffort getSegmentEffortById(String id); List<StravaSegmentEffort> getAllSegmentEfforts(String segmentId, String startTime, String endTime); }
SegmentEffortTemplate extends AbstractStravaOperations implements SegmentEffortOperations { public StravaSegmentEffort getSegmentEffortById(String id) { return restTemplate.getForObject(buildUri("/segment_efforts/" + id), StravaSegmentEffort.class); } SegmentEffortTemplate(RestTemplate restTemplate, boolean isAuthorizedForUser); List<StravaSegmentEffort> getSegmentEfforts(String segmentId, String athleteId); StravaSegmentEffort getSegmentEffortById(String id); List<StravaSegmentEffort> getAllSegmentEfforts(String segmentId, String startTime, String endTime);  }