orderingService.confirm(orderId, new OrderDetailsCommand(), offer);
}
@Test
public void canNotPurchaseIfOfferChanged(){
AggregateId orderId = orderingService.createOrder();
orderingService.addProduct(orderId, new AggregateId("p1"), 1);
orderingService.addProduct(orderId, new AggregateId("p2"), 20);
Offer offer = orderingService.calculateOffer(orderId);
//change order
orderingService.addProduct(orderId, new AggregateId("p2"), 30);
//confirm obsolete offer
try{
orderingService.confirm(orderId, new OrderDetailsCommand(), offer);
Assert.fail();
}