Skip to content

Commit

Permalink
fix(samples): lro added out-of-order step. (#539)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
dfirova and gcf-owl-bot[bot] authored Sep 21, 2022
1 parent 92037e8 commit 7913182
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7913182

Please sign in to comment.