PushTemplate implements PushOperations { public List<PushStatistics> getStatistics(Date start, Date end) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd+HH:mm"); String startString = format.format(start); String endString = format.format(end); try { return (List<PushStatistics>) masterKeyRestOperations.getForObject(new URI(PUSH_URL + "stats/?start=" + startString + "&end=" + endString), PushStatisticsList.class); } catch (URISyntaxException shouldntHappen) { return null; } } PushTemplate(RestOperations masterKeyRestOperations); PushResponse pushNotification(Notification notification); void pushNotifications(List<Notification> notifications); void sendBroadcast(Broadcast broadcast); List<PushStatistics> getStatistics(Date start, Date end);  }
@Test @Ignore("Temporarily ignoring time-sensitive tests") public void getStatistics() { masterKeyMockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withResponse(jsonResource("data/statistics"), responseHeaders)); List<PushStatistics> statistics = urbanAirship.pushOperations().getStatistics(new Date(1333515600000L), new Date(1333710000000L)); assertEquals(6, statistics.size()); masterKeyMockServer.verify(); }