public final class ChangeTextLineItemQuantity extends UpdateActionImpl<ShoppingList>
See also ShoppingListInStoreUpdateCommand.
withTaxedProduct(client(), product -> { final ShoppingListDraftDsl shoppingListDraft = newShoppingListDraftWithTextLineItem(3L); withShoppingList(client(), shoppingListDraft, shoppingList -> { final TextLineItem textLineItem = shoppingList.getTextLineItems().get(0); final ShoppingList updatedShoppingList = client().executeBlocking( ShoppingListUpdateCommand.of(shoppingList, ChangeTextLineItemQuantity.of(textLineItem, 2L))); assertThat(updatedShoppingList.getTextLineItems()).hasSize(1); final TextLineItem updatedTextLineItem = updatedShoppingList.getTextLineItems().get(0); assertThat(updatedTextLineItem.getQuantity()).isEqualTo(2L); return updatedShoppingList; }); });
See the test code.
ShoppingList.getTextLineItems()
Modifier and Type | Method and Description |
---|---|
Long |
getQuantity() |
String |
getTextLineItemId() |
static ChangeTextLineItemQuantity |
of(String textLineItemId,
Long quantity) |
static ChangeTextLineItemQuantity |
of(TextLineItem textLineItem,
Long quantity) |
getAction
public static ChangeTextLineItemQuantity of(String textLineItemId, Long quantity)
public static ChangeTextLineItemQuantity of(TextLineItem textLineItem, Long quantity)
public String getTextLineItemId()
public Long getQuantity()