Skip to content

Commit 9359ffe

Browse files
dfirovagcf-owl-bot[bot]
authored andcommitted
fix(samples): lro added out-of-order step. (#539)
* fix(samples): lro added out-of-order step. * pr fix: different timestamp. * pr fix: fixed test. * pr fix: fixed comment. * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent cc98f30 commit 9359ffe

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

retail/interactive-tutorials/src/main/java/product/AddFulfillmentPlaces.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ public static void addFulfillmentPlaces(String productName, String placeId)
5656
.setAllowMissing(true)
5757
.build();
5858

59+
// To send an out-of-order request assign the invalid AddTime here:
60+
// Instant instant = LocalDateTime.now().minusDays(1).toInstant(ZoneOffset.UTC);
61+
// Timestamp previousDay = Timestamp.newBuilder()
62+
// .setSeconds(instant.getEpochSecond())
63+
// .setNanos(instant.getNano())
64+
// .build();
65+
// addFulfillmentPlacesRequest =
66+
// addFulfillmentPlacesRequest.toBuilder().setAddTime(previousDay).build();
67+
5968
System.out.println("Add fulfillment request " + addFulfillmentPlacesRequest);
6069

6170
// Initialize client that will be used to send requests. This client only

retail/interactive-tutorials/src/main/java/product/RemoveFulfillmentPlaces.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ public static void removeFulfillmentPlaces(String productName, String storeId)
5757
.setAllowMissing(true)
5858
.build();
5959

60+
// To send an out-of-order request assign the invalid RemoveTime here:
61+
// Instant instant = LocalDateTime.now().minusDays(1).toInstant(ZoneOffset.UTC);
62+
// Timestamp previousDay = Timestamp.newBuilder()
63+
// .setSeconds(instant.getEpochSecond())
64+
// .setNanos(instant.getNano())
65+
// .build();
66+
// removeFulfillmentRequest =
67+
// removeFulfillmentRequest.toBuilder().setRemoveTime(previousDay).build();
68+
6069
System.out.println("Remove fulfillment request " + removeFulfillmentRequest);
6170

6271
// Initialize client that will be used to send requests. This client only

retail/interactive-tutorials/src/main/java/product/SetInventory.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ public static void setInventory(String productName) throws IOException, Interrup
9393
.build();
9494
System.out.printf("Set inventory request: %s%n", setInventoryRequest);
9595

96+
// To send an out-of-order request assign the invalid SetTime here:
97+
// Instant instant = LocalDateTime.now().minusDays(1).toInstant(ZoneOffset.UTC);
98+
// Timestamp previousDay = Timestamp.newBuilder()
99+
// .setSeconds(instant.getEpochSecond())
100+
// .setNanos(instant.getNano())
101+
// .build();
102+
// setInventoryRequest = setInventoryRequest.toBuilder().setSetTime(previousDay).build();
103+
96104
// Initialize client that will be used to send requests. This client only
97105
// needs to be created once, and can be reused for multiple requests. After
98106
// completing all of your requests, call the "close" method on the client to

0 commit comments

Comments
 (0)