Skip to content

Commit

Permalink
Handle HTTP binding error. (dapr#1024) (dapr#1130)
Browse files Browse the repository at this point in the history
Update binding http IT

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
  • Loading branch information
artursouza authored and salaboy committed Oct 4, 2024
1 parent a378c52 commit 255e00a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sdk-tests/src/test/java/io/dapr/it/binding/http/BindingIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...");
Expand All @@ -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 ...");
Expand Down Expand Up @@ -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(
Expand All @@ -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(() -> {
Expand Down

0 comments on commit 255e00a

Please sign in to comment.