Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

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] committed Sep 21, 2022
1 parent f9456b1 commit 2befbb1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
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
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
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 2befbb1

Please sign in to comment.