2424import jakarta .ws .rs .client .Invocation .Builder ;
2525import jakarta .ws .rs .client .WebTarget ;
2626import java .net .URI ;
27- import java .util .List ;
27+ import java .util .Collection ;
2828import java .util .Map ;
2929import java .util .Map .Entry ;
3030import java .util .Optional ;
@@ -38,7 +38,7 @@ public class HttpExecutor implements CallableTask {
3838 private final Optional <WorkflowValueResolver <Map <String , Object >>> headersMap ;
3939 private final Optional <WorkflowValueResolver <Map <String , Object >>> queryMap ;
4040 private final RequestExecutor requestFunction ;
41- private final List < RequestDecorator > requestDecorators ;
41+ private final Collection < HttpRequestDecorator > requestDecorators ;
4242
4343 HttpExecutor (
4444 WorkflowValueResolver <URI > uriSupplier ,
@@ -52,7 +52,7 @@ public class HttpExecutor implements CallableTask {
5252 this .requestFunction = requestFunction ;
5353 this .pathSupplier = pathSupplier ;
5454 this .requestDecorators =
55- ServiceLoader .load (RequestDecorator .class ).stream ()
55+ ServiceLoader .load (HttpRequestDecorator .class ).stream ()
5656 .map (ServiceLoader .Provider ::get )
5757 .sorted ()
5858 .toList ();
@@ -75,11 +75,7 @@ public CompletableFuture<WorkflowModel> apply(
7575 target = target .queryParam (entry .getKey (), entry .getValue ());
7676 }
7777 Builder request = target .request ();
78-
79- for (RequestDecorator requestDecorator : requestDecorators ) {
80- requestDecorator .decorate (request , workflow , taskContext );
81- }
82-
78+ requestDecorators .forEach (d -> d .decorate (request , workflow , taskContext ));
8379 headersMap .ifPresent (h -> h .apply (workflow , taskContext , input ).forEach (request ::header ));
8480 return CompletableFuture .supplyAsync (
8581 () -> requestFunction .apply (request , uri , workflow , taskContext , input ),
0 commit comments