From 255e00a415c2ef923d043a1e653766df48a3db63 Mon Sep 17 00:00:00 2001 From: Artur Souza Date: Wed, 18 Sep 2024 11:13:17 -0700 Subject: [PATCH] Handle HTTP binding error. (#1024) (#1130) Update binding http IT Signed-off-by: Artur Souza --- .../java/io/dapr/it/binding/http/BindingIT.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sdk-tests/src/test/java/io/dapr/it/binding/http/BindingIT.java b/sdk-tests/src/test/java/io/dapr/it/binding/http/BindingIT.java index 8b104f0d8..e023ef9ea 100644 --- a/sdk-tests/src/test/java/io/dapr/it/binding/http/BindingIT.java +++ b/sdk-tests/src/test/java/io/dapr/it/binding/http/BindingIT.java @@ -38,10 +38,10 @@ public class BindingIT extends BaseIT { @Test public void httpOutputBindingError() throws Exception { - var run = startDaprApp( + startDaprApp( this.getClass().getSimpleName() + "-httpoutputbinding-exception", 60000); - try(DaprClient client = run.newDaprClientBuilder().build()) { + try(DaprClient client = new DaprClientBuilder().build()) { // Validate error message callWithRetry(() -> { System.out.println("Checking exception handling for output binding ..."); @@ -61,10 +61,10 @@ public void httpOutputBindingError() throws Exception { @Test public void httpOutputBindingErrorIgnoredByComponent() throws Exception { - var run = startDaprApp( + startDaprApp( this.getClass().getSimpleName() + "-httpoutputbinding-ignore-error", 60000); - try(DaprClient client = run.newDaprClientBuilder().build()) { + try(DaprClient client = new DaprClientBuilder().build()) { // Validate error message callWithRetry(() -> { System.out.println("Checking exception handling for output binding ..."); @@ -93,7 +93,7 @@ public void inputOutputBinding() throws Exception { var bidingName = "sample123"; - try(DaprClient client = daprRun.newDaprClientBuilder().build()) { + try(DaprClient client = new DaprClientBuilder().build()) { callWithRetry(() -> { System.out.println("Checking if input binding is up before publishing events ..."); client.invokeBinding( @@ -116,14 +116,14 @@ public void inputOutputBinding() throws Exception { System.out.println("sending first message"); client.invokeBinding( - bidingName, "create", myClass, Map.of("MyMetadata", "MyValue"), Void.class).block(); + bidingName, "create", myClass, Collections.singletonMap("MyMetadata", "MyValue"), Void.class).block(); // This is an example of sending a plain string. The input binding will receive // cat final String m = "cat"; System.out.println("sending " + m); client.invokeBinding( - bidingName, "create", m, Map.of("MyMetadata", "MyValue"), Void.class).block(); + bidingName, "create", m, Collections.singletonMap("MyMetadata", "MyValue"), Void.class).block(); // Metadata is not used by Kafka component, so it is not possible to validate. callWithRetry(() -> {