package de.neusta.hybris.wishlist;
...
@UnitTest
public class WishlistModelTest
{
@Test
public void testCreatingNewWishlistForCustomerWithProduct()
{
final CustomerModel customer = new CustomerModel();
customer.setUid("hans@dampf.de");
final ProductModel product = new ProductModel();
product.setCode("1234");
final WishlistModel newWishlist = new WishlistModel();
newWishlist.setCustomer(customer);
final WishlistEntryModel newEntry = new WishlistEntryModel();
newEntry.setProduct(product);
newWishlist.setEntries(Arrays.asList(newEntry));
assertThat(newWishlist.getEntries().iterator().next().getProduct().getCode(), is("1234"));
assertThat(newWishlist.getCustomer().getUid(), is("hans@dampf.de"));
}
}