public final class SetCustomerGroup extends UpdateActionImpl<Cart>
See also CartInStoreUpdateCommand.
withB2cCustomerGroup(client(), customerGroup -> { final Cart cart = createCartWithCountry(client()); assertThat(cart.getCustomerGroup()).isNull(); Cart updatedCart = client().executeBlocking(CartUpdateCommand.of(cart, SetCustomerGroup.of(customerGroup))); assertThat(updatedCart.getCustomerGroup().toReference()).isEqualTo(customerGroup.toReference()); client().executeBlocking(CartDeleteCommand.of(updatedCart)); });
See the test code.
Modifier and Type | Method and Description |
---|---|
ResourceIdentifier<CustomerGroup> |
getCustomerGroup() |
static SetCustomerGroup |
of(ResourceIdentifiable<CustomerGroup> customerGroup) |
getAction
public static SetCustomerGroup of(@Nullable ResourceIdentifiable<CustomerGroup> customerGroup)
public ResourceIdentifier<CustomerGroup> getCustomerGroup()