@Test public void sendBroadcast() { masterKeyMockServer.expect(requestTo("https: .andExpect(header("Content-Type", "application/json")) .andExpect(body(readCompactedJsonResource(jsonResource("data/push-broadcast")))) .andExpect(method(POST)) .andRespond(withResponse("", responseHeaders, HttpStatus.OK, "Okay")); urbanAirship.pushOperations().sendBroadcast(Broadcast.builder("Hey!").build()); }
public void sendBroadcast(Broadcast broadcast) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity<Broadcast> requestEntity = new HttpEntity<Broadcast>(broadcast, headers); masterKeyRestOperations.exchange(PUSH_URL + "broadcast/", HttpMethod.POST, requestEntity, String.class); }
PushTemplate implements PushOperations { public void sendBroadcast(Broadcast broadcast) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity<Broadcast> requestEntity = new HttpEntity<Broadcast>(broadcast, headers); masterKeyRestOperations.exchange(PUSH_URL + "broadcast/", HttpMethod.POST, requestEntity, String.class); } }
PushTemplate implements PushOperations { public void sendBroadcast(Broadcast broadcast) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity<Broadcast> requestEntity = new HttpEntity<Broadcast>(broadcast, headers); masterKeyRestOperations.exchange(PUSH_URL + "broadcast/", HttpMethod.POST, requestEntity, String.class); } PushTemplate(RestOperations masterKeyRestOperations); }
PushTemplate implements PushOperations { public void sendBroadcast(Broadcast broadcast) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity<Broadcast> requestEntity = new HttpEntity<Broadcast>(broadcast, headers); masterKeyRestOperations.exchange(PUSH_URL + "broadcast/", 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); }
PushTemplate implements PushOperations { public void sendBroadcast(Broadcast broadcast) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity<Broadcast> requestEntity = new HttpEntity<Broadcast>(broadcast, headers); masterKeyRestOperations.exchange(PUSH_URL + "broadcast/", 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);  }