public final class OrderShippingAddressSetMessage extends GenericMessageImpl<Order> implements SimpleOrderMessage
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, resourceUserProvidedIdentifiers, resourceVersion, sequenceNumber, type| Modifier and Type | Method and Description |
|---|---|
Address |
getAddress() |
as, equals, getPayload, getResource, getResourceUserProvidedIdentifiers, getResourceVersion, getSequenceNumber, getType, hashCode, toReferencegetCreatedAt, getId, getLastModifiedAt, getVersionclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetResourceas, getPayload, getResourceUserProvidedIdentifiers, getResourceVersion, getSequenceNumber, getType, referenceOfId, referenceTypeId, toReference, typeReferencegetCreatedAt, getId, getLastModifiedAt, getVersionhasSameIdAs, toResourceIdentifiergetTypepublic static final String MESSAGE_TYPE
public static final MessageDerivateHint<OrderShippingAddressSetMessage> MESSAGE_HINT