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