diff --git a/samples/interactive-tutorials/src/main/java/product/AddFulfillmentPlaces.java b/samples/interactive-tutorials/src/main/java/product/AddFulfillmentPlaces.java index 2c6a63cc..d33562b2 100644 --- a/samples/interactive-tutorials/src/main/java/product/AddFulfillmentPlaces.java +++ b/samples/interactive-tutorials/src/main/java/product/AddFulfillmentPlaces.java @@ -56,6 +56,15 @@ public static void addFulfillmentPlaces(String productName, String placeId) .setAllowMissing(true) .build(); + // To send an out-of-order request assign the invalid AddTime here: + // Instant instant = LocalDateTime.now().minusDays(1).toInstant(ZoneOffset.UTC); + // Timestamp previousDay = Timestamp.newBuilder() + // .setSeconds(instant.getEpochSecond()) + // .setNanos(instant.getNano()) + // .build(); + // addFulfillmentPlacesRequest = + // addFulfillmentPlacesRequest.toBuilder().setAddTime(previousDay).build(); + System.out.println("Add fulfillment request " + addFulfillmentPlacesRequest); // Initialize client that will be used to send requests. This client only diff --git a/samples/interactive-tutorials/src/main/java/product/RemoveFulfillmentPlaces.java b/samples/interactive-tutorials/src/main/java/product/RemoveFulfillmentPlaces.java index 35e7b8f0..eb8d23a0 100644 --- a/samples/interactive-tutorials/src/main/java/product/RemoveFulfillmentPlaces.java +++ b/samples/interactive-tutorials/src/main/java/product/RemoveFulfillmentPlaces.java @@ -57,6 +57,15 @@ public static void removeFulfillmentPlaces(String productName, String storeId) .setAllowMissing(true) .build(); + // To send an out-of-order request assign the invalid RemoveTime here: + // Instant instant = LocalDateTime.now().minusDays(1).toInstant(ZoneOffset.UTC); + // Timestamp previousDay = Timestamp.newBuilder() + // .setSeconds(instant.getEpochSecond()) + // .setNanos(instant.getNano()) + // .build(); + // removeFulfillmentRequest = + // removeFulfillmentRequest.toBuilder().setRemoveTime(previousDay).build(); + System.out.println("Remove fulfillment request " + removeFulfillmentRequest); // Initialize client that will be used to send requests. This client only diff --git a/samples/interactive-tutorials/src/main/java/product/SetInventory.java b/samples/interactive-tutorials/src/main/java/product/SetInventory.java index 0a16d408..513ba27d 100644 --- a/samples/interactive-tutorials/src/main/java/product/SetInventory.java +++ b/samples/interactive-tutorials/src/main/java/product/SetInventory.java @@ -93,6 +93,14 @@ public static void setInventory(String productName) throws IOException, Interrup .build(); System.out.printf("Set inventory request: %s%n", setInventoryRequest); + // To send an out-of-order request assign the invalid SetTime here: + // Instant instant = LocalDateTime.now().minusDays(1).toInstant(ZoneOffset.UTC); + // Timestamp previousDay = Timestamp.newBuilder() + // .setSeconds(instant.getEpochSecond()) + // .setNanos(instant.getNano()) + // .build(); + // setInventoryRequest = setInventoryRequest.toBuilder().setSetTime(previousDay).build(); + // Initialize client that will be used to send requests. This client only // needs to be created once, and can be reused for multiple requests. After // completing all of your requests, call the "close" method on the client to