@Test(expected = ApiException.class) public void itemsItemIdPutTestFailsIfAccessTokenNull() throws ApiException { String accessToken = null; String itemId = "MLA742781879"; ItemJson body = new ItemJson(); body.price(100); api.itemsItemIdPut(itemId, accessToken, body); }
@Test(expected = ApiException.class) public void defaultPutTestFailsIfIdIsNull() throws ApiException { String id = null; String resource = "items"; ItemJson body = new ItemJson(); body.price(100); api.defaultPut(resource, id, accessToken, body); }
@Test(expected = ApiException.class) public void itemsItemIdPutTestFailsIfItemIdInvalid() throws ApiException { String itemId = null; ItemJson body = new ItemJson(); body.price(100); api.itemsItemIdPut(itemId, accessToken, body); }
/** * Update an object. * * @throws ApiException if the Api call fails */ @Test public void defaultPutTest() throws ApiException { String id = "MLA742781879"; String resource = "items"; ItemJson body = new ItemJson(); body.price(100); Object response = api.defaultPut(resource, id, accessToken, body); assertNotNull(response); }
@Test(expected = ApiException.class) public void itemsPostTestFailsIfBodyIsInvalid() throws ApiException { ItemJson body = new ItemJson(); body.title("TEST TITLE"); body.listingTypeId("gold_special"); body.price(10); api.itemsPost(accessToken, body); }
@Test(expected = ApiException.class) public void itemsValidatePostTestFailsIfBodyIsInvalid() throws ApiException { ItemJson body = new ItemJson(); body.title("TEST TITLE"); body.listingTypeId("gold_special"); body.price(10); api.itemsValidatePost(accessToken, body); }
@Test(expected = ApiException.class) public void defaultPostTestFailsIfBodyIsInvalid() throws ApiException { String resource = "items"; ItemJson body = new ItemJson(); body.title("TEST TITLE"); body.listingTypeId("gold_special"); body.price(10); api.defaultPost(accessToken, resource, body); }
/** * Update an item. * * @throws ApiException if the Api call fails */ @Test public void itemsItemIdPutTest() throws ApiException { String itemId = "MLA742781879"; ItemJson body = new ItemJson(); body.price(10); ItemResponse response = api.itemsItemIdPut(itemId, accessToken, body); assertNotNull(response); assertEquals(itemId, response.getId()); assertEquals(body.getPrice(), response.getPrice()); }
@Test(expected = ApiException.class) public void defaultPostTestFailsIfResourceIsInvalid() throws ApiException { String resource = "123test"; ItemJson body = new ItemJson(); body.title("TEST TITLE"); body.listingTypeId("gold_special"); body.price(10); body.categoryId("MLA3530"); body.buyingMode("buy_it_now"); body.currencyId("ARS"); body.condition("new"); body.availableQuantity(2); body.siteId("MLA"); api.defaultPost(accessToken, resource, body); }
@Test(expected = ApiException.class) public void itemsPostTestFailsIfAcccessTokenIsNull() throws ApiException { String accessToken = null; ItemJson body = new ItemJson(); body.title("TEST TITLE"); body.listingTypeId("gold_special"); body.price(10); body.categoryId("MLA3530"); body.buyingMode("buy_it_now"); body.currencyId("ARS"); body.condition("new"); body.availableQuantity(2); body.siteId("MLA"); api.itemsPost(accessToken, body); }
@Test(expected = ApiException.class) public void defaultPostTestFailsIfAccessTokenIsNull() throws ApiException { String accessToken = null; String resource = "items"; ItemJson body = new ItemJson(); body.title("TEST TITLE"); body.listingTypeId("gold_special"); body.price(10); body.categoryId("MLA3530"); body.buyingMode("buy_it_now"); body.currencyId("ARS"); body.condition("new"); body.availableQuantity(2); body.siteId("MLA"); api.defaultPost(accessToken, resource, body); }
/** * Make a POST to any resource. * * @throws ApiException if the Api call fails */ @Test public void defaultPostTest() throws ApiException { String resource = "items"; ItemJson body = new ItemJson(); body.title("TEST TITLE"); body.listingTypeId("gold_special"); body.price(10); body.categoryId("MLA3530"); body.buyingMode("buy_it_now"); body.currencyId("ARS"); body.condition("new"); body.availableQuantity(2); body.siteId("MLA"); Object response = api.defaultPost(accessToken, resource, body); assertNotNull(response); }
/** * Validate the JSON before listing an item. * * @throws ApiException if the Api call fails */ @Test public void itemsValidatePostTest() throws ApiException { ItemJson body = new ItemJson(); body.title("TEST TITLE"); body.listingTypeId("gold_special"); body.price(10); body.categoryId("MLA3530"); body.buyingMode("buy_it_now"); body.currencyId("ARS"); body.condition("new"); body.availableQuantity(2); body.siteId("MLA"); Object response = api.itemsValidatePost(accessToken, body); assertNull(response); }
/** * List an item. * * @throws ApiException if the Api call fails */ @Test public void itemsPostTest() throws ApiException { ItemJson body = new ItemJson(); body.title("TEST TITLE"); body.listingTypeId("gold_special"); body.price(10); body.categoryId("MLA3530"); body.buyingMode("buy_it_now"); body.currencyId("ARS"); body.condition("new"); body.availableQuantity(2); body.siteId("MLA"); ItemResponse response = api.itemsPost(accessToken, body); assertNotNull(response); assertEquals(body.getTitle().toLowerCase(), (response.getTitle().toLowerCase())); assertEquals(body.getSiteId(), response.getSiteId()); assertEquals(body.getPrice(), response.getPrice()); assertEquals(body.getCategoryId(), response.getCategoryId()); }