public final class ImportCustomLineItemState extends UpdateActionImpl<Order>
See also OrderUpdateCommand.
withStandardStates(client(), (State initialState, State nextState) -> withOrderOfCustomLineItems(client(), order -> { final CustomLineItem customLineItem = order.getCustomLineItems().get(0); assertThat(customLineItem).has(state(initialState)).has(not(state(nextState))); final Set<ItemState> itemStates = asSet(ItemState.of(nextState, 1L), ItemState.of(initialState, customLineItem.getQuantity() - 1)); final Order updatedOrder = client().executeBlocking(OrderUpdateCommand.of(order, ImportCustomLineItemState.of(customLineItem, itemStates))); assertThat(updatedOrder.getCustomLineItems().get(0)).has(itemStates(itemStates)); }) );
See the test code.
Modifier and Type | Method and Description |
---|---|
String |
getCustomLineItemId() |
Set<ItemState> |
getState() |
static ImportCustomLineItemState |
of(CustomLineItem CustomLineItem,
Set<ItemState> itemState) |
static ImportCustomLineItemState |
of(String CustomLineItemId,
Set<ItemState> itemState) |
getAction
public String getCustomLineItemId()
public static ImportCustomLineItemState of(CustomLineItem CustomLineItem, Set<ItemState> itemState)
public static ImportCustomLineItemState of(String CustomLineItemId, Set<ItemState> itemState)