InAppPurchaseTemplate implements InAppPurchaseOperations { public List<InventoryItem> getInventory() { return restOperations.getForObject(IAP_URL + "content", Inventory.class); } InAppPurchaseTemplate(RestOperations restOperations); List<InventoryItem> getInventory(); String getDownloadUrl(String productId); String getDownloadUrl(String productId, ContentReceipt receipt); List<Product> checkForUpdates(List<Product> products);  }
@Test public void getInventory() { mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withResponse(jsonResource("data/iap-inventory"), responseHeaders)); List<InventoryItem> items = urbanAirship.inAppPurchaseOperations().getInventory(); assertEquals("Content", items.get(0).getName()); assertEquals("http: assertEquals("http: assertEquals("http: assertEquals("https: assertEquals("1", items.get(0).getCurrentRevision()); assertEquals("1234", items.get(0).getProductId()); assertFalse(items.get(0).isFree()); assertEquals(49137, items.get(0).getFileSize()); assertEquals("Description", items.get(0).getDescription()); assertEquals("Some Content", items.get(1).getName()); assertEquals("http: assertEquals("http: assertEquals("http: assertEquals("https: assertEquals("3", items.get(1).getCurrentRevision()); assertEquals("1235", items.get(1).getProductId()); assertTrue(items.get(1).isFree()); assertEquals(58392, items.get(1).getFileSize()); assertEquals("Some description", items.get(1).getDescription()); mockServer.verify(); }