@Test public void createFeed() { masterKeyMockServer.expect(requestTo("https: .andExpect(method(POST)) .andExpect(body(readCompactedJsonResource(jsonResource("data/feed-create")))) .andRespond(withResponse(jsonResource("data/feed"), responseHeaders)); FeedConfig feedConfig = FeedConfig.builder("https: Feed feed = urbanAirship.feedOperations().createFeed(feedConfig); assertSingleFeed(feed); masterKeyMockServer.verify(); }
public Feed createFeed(FeedConfig feedConfig) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON)); HttpEntity<FeedConfig> requestEntity = new HttpEntity<FeedConfig>(feedConfig, headers); return restOperations.exchange(FEED_URL, HttpMethod.POST, requestEntity, Feed.class).getBody(); }
FeedTemplate implements FeedOperations { public Feed createFeed(FeedConfig feedConfig) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON)); HttpEntity<FeedConfig> requestEntity = new HttpEntity<FeedConfig>(feedConfig, headers); return restOperations.exchange(FEED_URL, HttpMethod.POST, requestEntity, Feed.class).getBody(); } }
FeedTemplate implements FeedOperations { public Feed createFeed(FeedConfig feedConfig) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON)); HttpEntity<FeedConfig> requestEntity = new HttpEntity<FeedConfig>(feedConfig, headers); return restOperations.exchange(FEED_URL, HttpMethod.POST, requestEntity, Feed.class).getBody(); } FeedTemplate(RestOperations restOperations); }
FeedTemplate implements FeedOperations { public Feed createFeed(FeedConfig feedConfig) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON)); HttpEntity<FeedConfig> requestEntity = new HttpEntity<FeedConfig>(feedConfig, headers); return restOperations.exchange(FEED_URL, HttpMethod.POST, requestEntity, Feed.class).getBody(); } FeedTemplate(RestOperations restOperations); Feed createFeed(FeedConfig feedConfig); Feed getFeed(String feedId); List<Feed> getFeeds(); void updateFeed(String feedId, FeedConfig feedConfig); void deleteFeed(String feedId); }
FeedTemplate implements FeedOperations { public Feed createFeed(FeedConfig feedConfig) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON)); HttpEntity<FeedConfig> requestEntity = new HttpEntity<FeedConfig>(feedConfig, headers); return restOperations.exchange(FEED_URL, HttpMethod.POST, requestEntity, Feed.class).getBody(); } FeedTemplate(RestOperations restOperations); Feed createFeed(FeedConfig feedConfig); Feed getFeed(String feedId); List<Feed> getFeeds(); void updateFeed(String feedId, FeedConfig feedConfig); void deleteFeed(String feedId);  }