}
@Test(groups = {"testOfferDelete"}, dependsOnGroups = { "testFulfillmentGroupOffers"})
@Transactional
public void testOfferDelete() throws Exception {
CustomerOffer customerOffer = customerOfferDao.create();
Customer customer = createCustomer();
Long customerId = customer.getId();
customerOffer.setCustomer(customerService.saveCustomer(customer));
Offer offer = createOfferUtility.createOffer("1.20 Dollars Off Order Offer", OfferType.ORDER, OfferDiscountType.AMOUNT_OFF, 1.20, null, null, true, true, 10);
offer = offerService.save(offer);
Long offerId = offer.getId();
offerDao.delete(offer);
Offer deletedOffer = offerDao.readOfferById(offerId);
assert ((OfferImpl) deletedOffer).getArchived() == 'Y';
offer = createOfferUtility.createOffer("1.20 Dollars Off Order Offer", OfferType.ORDER, OfferDiscountType.AMOUNT_OFF, 1.20, null, null, true, true, 10);
offer = offerService.save(offer);
customerOffer.setOffer(offer);
customerOffer = customerOfferDao.save(customerOffer);
Long customerOfferId = customerOffer.getId();
customerOffer = customerOfferDao.readCustomerOfferById(customerOfferId);
assert(customerOffer != null);
Customer customer2 = createCustomer();
customerOffer.setCustomer(customerService.saveCustomer(customer2));
customerOffer = customerOfferDao.save(customerOffer);
assert !customerOffer.getCustomer().getId().equals(customerId);
customerOfferDao.delete(customerOffer);
customerOffer = customerOfferDao.readCustomerOfferById(customerOfferId);
assert customerOffer == null || ((OfferImpl) customerOffer).getArchived() == 'Y';