Skip to content

Commit

Permalink
Remove all global state from setProperty (dapr#1138)
Browse files Browse the repository at this point in the history
* Remove all global state in from setProperty

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* use Map.of

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Remove dependency that is not needed.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: salaboy <Salaboy@gmail.com>
  • Loading branch information
artursouza authored and salaboy committed Oct 4, 2024
1 parent 232bcff commit fbd8402
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,15 @@
import reactor.core.publisher.Hooks;
import reactor.core.publisher.Mono;
<<<<<<< HEAD
<<<<<<< HEAD
import reactor.util.context.Context;
import java.util.Collections;
import java.util.HashMap;
=======
=======

import java.util.Map;
>>>>>>> 7490434d (Remove all global state from setProperty (#1138))

>>>>>>> 7490434d (Remove all global state from setProperty (#1138))
import java.util.Map;
Expand Down
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 {
startDaprApp(
var run = startDaprApp(
this.getClass().getSimpleName() + "-httpoutputbinding-exception",
60000);
try(DaprClient client = new DaprClientBuilder().build()) {
try(DaprClient client = run.newDaprClientBuilder().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 {
startDaprApp(
var run = startDaprApp(
this.getClass().getSimpleName() + "-httpoutputbinding-ignore-error",
60000);
try(DaprClient client = new DaprClientBuilder().build()) {
try(DaprClient client = run.newDaprClientBuilder().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 = new DaprClientBuilder().build()) {
try(DaprClient client = daprRun.newDaprClientBuilder().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, Collections.singletonMap("MyMetadata", "MyValue"), Void.class).block();
bidingName, "create", myClass, Map.of("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, Collections.singletonMap("MyMetadata", "MyValue"), Void.class).block();
bidingName, "create", m, Map.of("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 fbd8402

Please sign in to comment.