public final class AbsoluteCartDiscountValue extends Base implements CartDiscountValue
withPersistentCartDiscount(client(), cartDiscount -> { final CartDiscountValue newValue = CartDiscountValue.ofAbsolute(MoneyImpl.of(randomInt(), EUR)); assertThat(cartDiscount.getValue()).isNotEqualTo(newValue); final CartDiscount updatedDiscount = client().executeBlocking(CartDiscountUpdateCommand.of(cartDiscount, ChangeValue.of(newValue))); assertThat(updatedDiscount.getValue()).isEqualTo(newValue); });
See the test code.
CartDiscountValue
,
CartDiscount.getValue()
,
ChangeValue
Modifier and Type | Method and Description |
---|---|
List<javax.money.MonetaryAmount> |
getMoney() |
static AbsoluteCartDiscountValue |
of(List<javax.money.MonetaryAmount> money) |
static AbsoluteCartDiscountValue |
of(javax.money.MonetaryAmount money) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
ofAbsolute, ofAbsolute, ofFixed, ofGiftLineItem, ofGiftLineItem, ofRelative
public List<javax.money.MonetaryAmount> getMoney()
public static AbsoluteCartDiscountValue of(javax.money.MonetaryAmount money)
public static AbsoluteCartDiscountValue of(List<javax.money.MonetaryAmount> money)