From ced0264d5690d4e95de1e960dd96fd846ae8ba46 Mon Sep 17 00:00:00 2001 From: dfirova <93149631+dfirova@users.noreply.github.com> Date: Thu, 11 Aug 2022 16:47:32 +0300 Subject: [PATCH] fix(samples) Add fulfillment places code sample: didn't work (#488) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Removed hardcoded parts. * Changed delay. * Merge conflict resolved: updated test. * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * PR fix: add fulfillment test. Co-authored-by: Owl Bot --- .../src/main/java/product/AddFulfillmentPlaces.java | 4 ++-- .../src/test/java/product/AddFulfillmentPlacesTest.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/java-retail/samples/interactive-tutorials/src/main/java/product/AddFulfillmentPlaces.java b/java-retail/samples/interactive-tutorials/src/main/java/product/AddFulfillmentPlaces.java index 34fb33216f65..31d9427364a5 100644 --- a/java-retail/samples/interactive-tutorials/src/main/java/product/AddFulfillmentPlaces.java +++ b/java-retail/samples/interactive-tutorials/src/main/java/product/AddFulfillmentPlaces.java @@ -77,8 +77,8 @@ public static void addFulfillmentPlaces(String productName, String placeId) serviceClient.addFulfillmentPlacesAsync(addFulfillmentPlacesRequest); // This is a long-running operation and its result is not immediately // present with get operations,thus we simulate wait with sleep method. - System.out.println("Add fulfillment places, wait 30 seconds: "); - TimeUnit.SECONDS.sleep(30); + System.out.println("Add fulfillment places, wait 45 seconds: "); + TimeUnit.SECONDS.sleep(45); } } } diff --git a/java-retail/samples/interactive-tutorials/src/test/java/product/AddFulfillmentPlacesTest.java b/java-retail/samples/interactive-tutorials/src/test/java/product/AddFulfillmentPlacesTest.java index 600a0aae19f0..e561cb42ab09 100644 --- a/java-retail/samples/interactive-tutorials/src/test/java/product/AddFulfillmentPlacesTest.java +++ b/java-retail/samples/interactive-tutorials/src/test/java/product/AddFulfillmentPlacesTest.java @@ -42,6 +42,7 @@ public class AddFulfillmentPlacesTest { @Before public void setUp() throws IOException, InterruptedException, ExecutionException { + // TODO(developer): Replace these variables before running the sample. String projectId = ServiceOptions.getDefaultProjectId(); String generatedProductId = UUID.randomUUID().toString(); String productName = @@ -64,7 +65,7 @@ public void testAddFulfillment() { String outputResult = bout.toString(); assertThat(outputResult).contains("Add fulfilment places with current date"); - assertThat(outputResult).contains("Add fulfillment places, wait 30 seconds"); + assertThat(outputResult).contains("Add fulfillment places, wait 45 seconds"); } @After