/* post(entity) /wishlists */ @Test public void testPostWithWishlist() { Wishlist wishlist = new Wishlist(); wishlist.setId(UUID.randomUUID().toString()); wishlist.setOwner(TestConstants.CUSTOMER); instanceList.add(wishlist.getId()); final Response response = createWishlist(wishlist); Assert.assertNotNull("Response must not be null", response); Assert.assertEquals( "Response does not have expected response code", Status.CREATED.getStatusCode(), response.getStatus()); }
/* post(entity) /wishlists */ @Test public void testPostWithInvalidWishlistOwner() { Wishlist wishlist = new Wishlist(); wishlist.setId(UUID.randomUUID().toString()); wishlist.setOwner("Test"); instanceList.add(wishlist.getId()); final Response response = createWishlist(wishlist); Assert.assertNotNull("Response must not be null", response); Assert.assertEquals( "Should return bad request when wishlist owner does not exist", Status.BAD_REQUEST.getStatusCode(), response.getStatus()); }
@Before public void before() { this.yaasAware = new YaasAwareParameters(); this.yaasAware.setHybrisClient(CLIENT); this.yaasAware.setHybrisTenant(TestConstants.TENANT); wishlist = new Wishlist(); wishlist.setId(UUID.randomUUID().toString()); wishlist.setDescription("Test"); wishlist.setOwner(TestConstants.CUSTOMER); instanceList.add(wishlist.getId()); createWishlist(wishlist); }
/* post(entity) /wishlists */ @Test public void testPostCheckDuplicateID() { Wishlist wishlist = new Wishlist(); wishlist.setId(UUID.randomUUID().toString()); wishlist.setOwner(TestConstants.CUSTOMER); instanceList.add(wishlist.getId()); createWishlist(wishlist); final Response response = createWishlist(wishlist); Assert.assertNotNull("Response must not be null", response); Assert.assertEquals( "Should return conflict when wishlist id is already used", Status.CONFLICT.getStatusCode(), response.getStatus()); }