@Test
public void importCustomLineItemState() throws Exception {
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));
})
);
}