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