diff --git a/impl/http/src/test/java/io/serverlessworkflow/impl/HTTPWorkflowDefinitionTest.java b/impl/http/src/test/java/io/serverlessworkflow/impl/HTTPWorkflowDefinitionTest.java index f3d77bdd..d9d2663a 100644 --- a/impl/http/src/test/java/io/serverlessworkflow/impl/HTTPWorkflowDefinitionTest.java +++ b/impl/http/src/test/java/io/serverlessworkflow/impl/HTTPWorkflowDefinitionTest.java @@ -64,9 +64,17 @@ void testWrongSchema(String fileName) { private static Stream provideParameters() { Map petInput = Map.of("petId", 10); + Map starTrekInput = Map.of("uid", "MOMA0000092393"); Condition petCondition = new Condition<>( o -> ((Map) o).containsKey("photoUrls"), "callHttpCondition"); + Condition starTrekCondition = + new Condition<>( + o -> + ((Map) ((Map) o).get("movie")) + .get("title") + .equals("Star Trek"), + "StartTrek"); return Stream.of( Arguments.of("callGetHttp.yaml", petInput, petCondition), Arguments.of( @@ -75,16 +83,9 @@ private static Stream provideParameters() { new Condition<>( o -> ((Map) o).containsKey("petId"), "notFoundCondition")), Arguments.of("call-http-endpoint-interpolation.yaml", petInput, petCondition), + Arguments.of("call-http-query-parameters.yaml", starTrekInput, starTrekCondition), Arguments.of( - "call-http-query-parameters.yaml", - Map.of("searchQuery", "R2-D2"), - new Condition<>( - o -> ((Map) o).get("count").equals(1), "R2D2Condition")), - Arguments.of( - "call-http-query-parameters-external-schema.yaml", - Map.of("searchQuery", "Luke Skywalker"), - new Condition<>( - o -> ((Map) o).get("count").equals(1), "TheRealJediCondition")), + "call-http-query-parameters-external-schema.yaml", starTrekInput, starTrekCondition), Arguments.of( "callPostHttp.yaml", Map.of("name", "Javierito", "status", "available"), diff --git a/impl/http/src/test/resources/call-http-query-parameters-external-schema.yaml b/impl/http/src/test/resources/call-http-query-parameters-external-schema.yaml index 9488592e..467b3632 100644 --- a/impl/http/src/test/resources/call-http-query-parameters-external-schema.yaml +++ b/impl/http/src/test/resources/call-http-query-parameters-external-schema.yaml @@ -8,11 +8,11 @@ input: resource: endpoint: schema/searchquery.yaml do: - - searchStarWarsCharacters: + - searchStarTrekMovies: call: http with: method: get - endpoint: https://swapi.dev/api/people/ + endpoint: https://stapi.co/api/v1/rest/movie query: - search: ${.searchQuery} + uid: ${.uid} diff --git a/impl/http/src/test/resources/call-http-query-parameters.yaml b/impl/http/src/test/resources/call-http-query-parameters.yaml index d209bf07..b207d092 100644 --- a/impl/http/src/test/resources/call-http-query-parameters.yaml +++ b/impl/http/src/test/resources/call-http-query-parameters.yaml @@ -8,16 +8,16 @@ input: document: type: object required: - - searchQuery + - uid properties: - searchQuery: + uid: type: string do: - - searchStarWarsCharacters: + - searchStarTrekMovies: call: http with: method: get - endpoint: https://swapi.dev/api/people/ + endpoint: https://stapi.co/api/v1/rest/movie query: - search: ${.searchQuery} + uid: ${.uid} diff --git a/impl/http/src/test/resources/schema/searchquery.yaml b/impl/http/src/test/resources/schema/searchquery.yaml index f6dde131..26b8e8d2 100644 --- a/impl/http/src/test/resources/schema/searchquery.yaml +++ b/impl/http/src/test/resources/schema/searchquery.yaml @@ -1,6 +1,6 @@ type: object required: - - searchQuery + - uid properties: - searchQuery: + uid: type: string \ No newline at end of file