use of org.broadleafcommerce.core.catalog.domain.UpSaleProductImpl in project BroadleafCommerce by BroadleafCommerce.
the class ProductDaoTest method getRelatedUpSaleProduct.
private static RelatedProduct getRelatedUpSaleProduct(Product prod, Product prodToRelate, List<RelatedProduct> upSales) {
RelatedProduct rp1 = new UpSaleProductImpl();
rp1.setProduct(prod);
rp1.setPromotionMessage("brand new coffee");
rp1.setRelatedProduct(prodToRelate);
upSales.add(rp1);
return rp1;
}
use of org.broadleafcommerce.core.catalog.domain.UpSaleProductImpl in project BroadleafCommerce by BroadleafCommerce.
the class ProductDaoTest method testReadProductsWithUpSaleValues.
@Test(groups = "testReadProductsWithUpSaleValues", dependsOnGroups = "createUpSaleValues")
@Transactional
public void testReadProductsWithUpSaleValues() {
Product result = productDao.readProductById(savedProducts.get(0).getId());
List<RelatedProduct> related = result.getUpSaleProducts();
assert (related != null);
assert (!related.isEmpty());
assert (related.size() == 2 || related.size() == 3);
for (RelatedProduct rp : related) {
assert (rp instanceof UpSaleProductImpl);
}
}
Aggregations