public final class SetTextLineItemDescription 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 LocalizedString newDescription = en(randomString()); final ShoppingList updatedShoppingList = client().executeBlocking( ShoppingListUpdateCommand.of(shoppingList, SetTextLineItemDescription.of(textLineItem).withDescription(newDescription))); assertThat(updatedShoppingList.getTextLineItems()).hasSize(1); final TextLineItem updatedTextLineItem = updatedShoppingList.getTextLineItems().get(0); assertThat(updatedTextLineItem.getDescription()).isEqualTo(newDescription); return updatedShoppingList; }); });
See the test code.
ShoppingList.getTextLineItems()
Modifier and Type | Method and Description |
---|---|
LocalizedString |
getDescription() |
String |
getTextLineItemId() |
static SetTextLineItemDescription |
of(String textLineItemId) |
static SetTextLineItemDescription |
of(TextLineItem textLineItem) |
SetTextLineItemDescription |
withDescription(LocalizedString description) |
getAction
public static SetTextLineItemDescription of(String textLineItemId)
public static SetTextLineItemDescription of(TextLineItem textLineItem)
public String getTextLineItemId()
@Nullable public LocalizedString getDescription()
public SetTextLineItemDescription withDescription(@Nullable LocalizedString description)