public final class SetRestockableInDays extends UpdateActionImpl<InventoryEntry>
See also InventoryEntryUpdateCommand.
withUpdateableInventoryEntry(client(), entry -> {
final int restockableInDays = Optional.ofNullable(entry.getRestockableInDays()).map(i -> i + 4).orElse(4);
final UpdateAction<InventoryEntry> action = SetRestockableInDays.of(restockableInDays);
final InventoryEntry updatedEntry = client().executeBlocking(InventoryEntryUpdateCommand.of(entry, action));
assertThat(updatedEntry.getRestockableInDays()).isEqualTo(restockableInDays);
return updatedEntry;
});
See the test code.
Modifier and Type | Method and Description |
---|---|
Integer |
getRestockableInDays() |
static SetRestockableInDays |
of(Integer restockableInDays) |
getAction
public static SetRestockableInDays of(@Nullable Integer restockableInDays)