### Question:
TripItTemplate extends AbstractOAuth1ApiBinding implements TripIt { public List<Trip> getUpcomingTrips() { return getRestTemplate().getForObject("https: } TripItTemplate(String consumerKey, String consumerSecret, String accessToken, String accessTokenSecret); String getProfileId(); String getProfileUrl(); TripItProfile getUserProfile(); List<Trip> getUpcomingTrips();  }### Answer:
@Test public void getTrips_manyTrips() { mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withSuccess(new ClassPathResource("many-trips.json", getClass()), MediaType.APPLICATION_JSON)); List<Trip> trips = tripIt.getUpcomingTrips(); assertEquals(2, trips.size()); Trip trip = trips.get(0); assertEquals(16104901, trip.getId()); assertEquals("Business", trip.getDisplayName()); assertEquals("Newark, NJ", trip.getPrimaryLocation()); assertEquals("https: assertDateEquals("2011-05-23", trip.getStartDate()); assertDateEquals("2011-05-25", trip.getEndDate()); trip = trips.get(1); assertEquals(16104707, trip.getId()); assertEquals("Vacation", trip.getDisplayName()); assertEquals("Branson, MO", trip.getPrimaryLocation()); assertEquals("https: assertDateEquals("2011-05-07", trip.getStartDate()); assertDateEquals("2011-05-14", trip.getEndDate()); }
@Test public void getTrips_oneTrip() { mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withSuccess(new ClassPathResource("one-trip.json", getClass()), MediaType.APPLICATION_JSON)); List<Trip> trips = tripIt.getUpcomingTrips(); assertEquals(1, trips.size()); Trip trip = trips.get(0); assertEquals(16104707, trip.getId()); assertEquals("Vacation", trip.getDisplayName()); assertEquals("Branson, MO", trip.getPrimaryLocation()); assertEquals("https: assertDateEquals("2011-05-07", trip.getStartDate()); assertDateEquals("2011-05-14", trip.getEndDate()); }
@Test public void getTrips_noUpcomingTrips() { mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withSuccess(new ClassPathResource("no-trips.json", getClass()), MediaType.APPLICATION_JSON)); List<Trip> trips = tripIt.getUpcomingTrips(); assertNotNull(trips); assertTrue(trips.isEmpty()); }