@Test public void sendBroadcast() { masterKeyMockServer.expect(requestTo("https: .andExpect(method(HttpMethod.POST)) .andExpect(body(readCompactedJsonResource(jsonResource("data/message-broadcast")))) .andRespond(withResponse("", responseHeaders, HttpStatus.OK, "Okay")); Map<String, String> extra = new LinkedHashMap<String, String>(); extra.put("key1","value1"); extra.put("key2","value2"); urbanAirship.richPushOperations().sendBroadcast( OutgoingMessage.builder("Hello").title("title").contentType("text/html").extra(extra) .notify("New message!", "cat.caf").build()); masterKeyMockServer.verify(); }
public void sendBroadcast(OutgoingMessage message) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity<OutgoingMessage> requestEntity = new HttpEntity<OutgoingMessage>(message, headers); restOperations.exchange(AIRMAIL_URL + "/broadcast", HttpMethod.POST, requestEntity, String.class); }
RichPushTemplate implements RichPushOperations { public void sendBroadcast(OutgoingMessage message) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity<OutgoingMessage> requestEntity = new HttpEntity<OutgoingMessage>(message, headers); restOperations.exchange(AIRMAIL_URL + "/broadcast", HttpMethod.POST, requestEntity, String.class); } }
RichPushTemplate implements RichPushOperations { public void sendBroadcast(OutgoingMessage message) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity<OutgoingMessage> requestEntity = new HttpEntity<OutgoingMessage>(message, headers); restOperations.exchange(AIRMAIL_URL + "/broadcast", HttpMethod.POST, requestEntity, String.class); } RichPushTemplate(RestOperations restOperations); }
RichPushTemplate implements RichPushOperations { public void sendBroadcast(OutgoingMessage message) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity<OutgoingMessage> requestEntity = new HttpEntity<OutgoingMessage>(message, headers); restOperations.exchange(AIRMAIL_URL + "/broadcast", HttpMethod.POST, requestEntity, String.class); } RichPushTemplate(RestOperations restOperations); void sendMessage(OutgoingMessage message); void sendBroadcast(OutgoingMessage message); }
RichPushTemplate implements RichPushOperations { public void sendBroadcast(OutgoingMessage message) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity<OutgoingMessage> requestEntity = new HttpEntity<OutgoingMessage>(message, headers); restOperations.exchange(AIRMAIL_URL + "/broadcast", HttpMethod.POST, requestEntity, String.class); } RichPushTemplate(RestOperations restOperations); void sendMessage(OutgoingMessage message); void sendBroadcast(OutgoingMessage message);  }