public final class OrderBillingAddressSetMessage extends GenericMessageImpl<Order> implements SimpleOrderMessage
withOrder(client(), order -> { assertThat(order.getBillingAddress()).isNull(); final Address newAddress = Address.of(DE).withStreetNumber("5"); final Order updatedOrder = client().executeBlocking(OrderUpdateCommand.of(order, SetBillingAddress.of(newAddress))); assertThat(updatedOrder.getBillingAddress().getStreetNumber()).isEqualTo("5"); //there is also a message final Query<OrderBillingAddressSetMessage> messageQuery = MessageQuery.of() .withPredicates(m -> m.resource().is(order)) .forMessageType(OrderBillingAddressSetMessage.MESSAGE_HINT); assertEventually(() -> { final Optional<OrderBillingAddressSetMessage> billingAddressSetMessageOptional = client().executeBlocking(messageQuery).head(); assertThat(billingAddressSetMessageOptional).isPresent(); final OrderBillingAddressSetMessage orderBillingAddressSetMessage = billingAddressSetMessageOptional.get(); assertThat(orderBillingAddressSetMessage.getAddress()).isEqualTo(newAddress); }); return updatedOrder; });
See the test code.
Order.getBillingAddress()
,
SetBillingAddress
Modifier and Type | Field and Description |
---|---|
static MessageDerivateHint<OrderBillingAddressSetMessage> |
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, toReference
getCreatedAt, getId, getLastModifiedAt, getVersion
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getResource
as, getPayload, getResourceUserProvidedIdentifiers, getResourceVersion, getSequenceNumber, getType, referenceOfId, referenceTypeId, toReference, typeReference
getCreatedAt, getId, getLastModifiedAt, getVersion
hasSameIdAs, toResourceIdentifier
getType
public static final String MESSAGE_TYPE
public static final MessageDerivateHint<OrderBillingAddressSetMessage> MESSAGE_HINT