public final class SetShippingAddress extends UpdateActionImpl<Order>
See also OrderUpdateCommand.
withOrder(client(), order -> { assertThat(order.getShippingAddress().getStreetNumber()).isNull(); final Address newAddress = order.getShippingAddress().withStreetNumber("5"); final Order updatedOrder = client().executeBlocking(OrderUpdateCommand.of(order, SetShippingAddress.of(newAddress))); assertThat(updatedOrder.getShippingAddress().getStreetNumber()).isEqualTo("5"); //there is also a message final Query<OrderShippingAddressSetMessage> messageQuery = MessageQuery.of() .withPredicates(m -> m.resource().is(order)) .forMessageType(OrderShippingAddressSetMessage.MESSAGE_HINT); assertEventually(() -> { final Optional<OrderShippingAddressSetMessage> shippingAddressSetMessageOptional = client().executeBlocking(messageQuery).head(); assertThat(shippingAddressSetMessageOptional).isPresent(); final OrderShippingAddressSetMessage orderShippingAddressSetMessage = shippingAddressSetMessageOptional.get(); assertThat(orderShippingAddressSetMessage.getAddress()).isEqualTo(newAddress); }); return updatedOrder; });
See the test code.
Modifier and Type | Method and Description |
---|---|
Address |
getAddress() |
static SetShippingAddress |
of(Address address) |
getAction
public static SetShippingAddress of(@Nullable Address address)