public final class SetCustomer extends UpdateActionImpl<ShoppingList>
See also ShoppingListInStoreUpdateCommand.
withCustomer(client(), customer -> {
withUpdateableShoppingList(client(), shoppingList -> {
final ShoppingList updatedShoppingList = client().executeBlocking(
ShoppingListUpdateCommand.of(shoppingList, SetCustomer.of(customer)));
assertThat(updatedShoppingList.getCustomer()).isEqualTo(customer.toReference());
return updatedShoppingList;
});
});
See the test code.
ShoppingList.getCustomer()
Modifier and Type | Method and Description |
---|---|
ResourceIdentifier<Customer> |
getCustomer() |
static SetCustomer |
of(ResourceIdentifiable<Customer> customer) |
static SetCustomer |
ofUnset() |
getAction
public static SetCustomer of(@Nullable ResourceIdentifiable<Customer> customer)
public static SetCustomer ofUnset()
@Nullable public ResourceIdentifier<Customer> getCustomer()