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

fix(samples): lro added out-of-order step. #539

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We strongly prefer not having commented out code, as it's not tested or compiled.

// .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