public final class UpdateSyncInfo extends UpdateActionImpl<Order>
See also OrderUpdateCommand.
withOrderExportChannel(client(), channel -> withOrder(client(), order -> { assertThat(order.getSyncInfo()).isEmpty(); final ZonedDateTime aDateInThePast = ZonedDateTime_IN_PAST; final String externalId = "foo"; final UpdateSyncInfo action = UpdateSyncInfo.of(channel).withExternalId(externalId).withSyncedAt(aDateInThePast); final Order updatedOrder = client().executeBlocking(OrderUpdateCommand.of(order, action)); assertThat(updatedOrder.getSyncInfo()).containsOnly(SyncInfo.of(channel, aDateInThePast, externalId)); //check channel expansion final OrderByIdGet orderByIdGet = OrderByIdGet.of(order).withExpansionPaths(m -> m.syncInfo().channel()); final Order loadedOrder = client().executeBlocking(orderByIdGet); assertThat(new ArrayList<>(loadedOrder.getSyncInfo()).get(0).getChannel().getObj()).isNotNull(); return updatedOrder; }) );
See the test code.
Modifier and Type | Method and Description |
---|---|
ResourceIdentifier<Channel> |
getChannel() |
String |
getExternalId() |
ZonedDateTime |
getSyncedAt() |
static UpdateSyncInfo |
of(Reference<Channel> channel,
String externalId,
ZonedDateTime syncedAt) |
static UpdateSyncInfo |
of(Referenceable<Channel> channel) |
static UpdateSyncInfo |
of(ResourceIdentifier<Channel> channel) |
static UpdateSyncInfo |
of(ResourceIdentifier<Channel> channel,
String externalId,
ZonedDateTime syncedAt) |
UpdateSyncInfo |
withExternalId(String externalId) |
UpdateSyncInfo |
withSyncedAt(ZonedDateTime syncedAt) |
getAction
public static UpdateSyncInfo of(ResourceIdentifier<Channel> channel, String externalId, ZonedDateTime syncedAt)
public static UpdateSyncInfo of(ResourceIdentifier<Channel> channel)
public static UpdateSyncInfo of(Reference<Channel> channel, String externalId, ZonedDateTime syncedAt)
public static UpdateSyncInfo of(Referenceable<Channel> channel)
public UpdateSyncInfo withExternalId(String externalId)
public UpdateSyncInfo withSyncedAt(ZonedDateTime syncedAt)
public ResourceIdentifier<Channel> getChannel()
@Nullable public ZonedDateTime getSyncedAt()