public static <T> SyncInfoExpansionModel<T> of() { return new SyncInfoExpansionModel<>(); }
public ExpansionPathContainer<T> channel() { return expansionPath("channel"); } }
@Test public void updateSyncInfo() throws Exception { 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; }) ); }
public SyncInfoExpansionModel<T> syncInfo() { //since it is a set, there is no method with index access return new SyncInfoExpansionModel<>(pathExpression(), "syncInfo[*]"); }