PushTemplate implements PushOperations { public void pushNotifications(List<Notification> notifications) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity<List<Notification>> requestEntity = new HttpEntity<List<Notification>>(notifications, headers); masterKeyRestOperations.exchange(PUSH_URL + "batch", HttpMethod.POST, requestEntity, String.class); } PushTemplate(RestOperations masterKeyRestOperations); PushResponse pushNotification(Notification notification); void pushNotifications(List<Notification> notifications); void sendBroadcast(Broadcast broadcast); List<PushStatistics> getStatistics(Date start, Date end);  }
@Test public void pushNotifications() { masterKeyMockServer.expect(requestTo("https: .andExpect(header("Content-Type", "application/json")) .andExpect(body(readCompactedJsonResource(jsonResource("data/push-notifications")))) .andExpect(method(POST)) .andRespond(withResponse(jsonResource("data/schedulefor-response"), responseHeaders, HttpStatus.OK, "Okay")); Notification notification1 = Notification.builder("Hey!").deviceTokens("token1", "token2").build(); Notification notification2 = Notification.builder("Yo!").aliases("alias1", "alias2").build(); urbanAirship.pushOperations().pushNotifications(Arrays.asList(notification1, notification2)); }