public final class OrderShippingAddressSetMessage extends GenericMessageImpl<Order>
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.
Order.getShippingAddress()
,
SetShippingAddress
Modifier and Type | Field and Description |
---|---|
static MessageDerivateHint<OrderShippingAddressSetMessage> |
MESSAGE_HINT |
static String |
MESSAGE_TYPE |
resource, resourceVersion, sequenceNumber, type
Modifier and Type | Method and Description |
---|---|
Address |
getAddress() |
as, equals, getPayload, getResource, getResourceVersion, getSequenceNumber, getType, hashCode, toReference
getCreatedAt, getId, getLastModifiedAt, getVersion
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
referenceOfId, referenceTypeId, typeReference
getCreatedAt, getId, getLastModifiedAt, getVersion
hasSameIdAs, toResourceIdentifier
public static final String MESSAGE_TYPE
public static final MessageDerivateHint<OrderShippingAddressSetMessage> MESSAGE_HINT