Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,17 @@ void testWrongSchema(String fileName) {

private static Stream<Arguments> provideParameters() {
Map<String, Object> petInput = Map.of("petId", 10);
Map<String, Object> starTrekInput = Map.of("uid", "MOMA0000092393");
Condition<Object> petCondition =
new Condition<>(
o -> ((Map<String, Object>) o).containsKey("photoUrls"), "callHttpCondition");
Condition<Object> starTrekCondition =
new Condition<>(
o ->
((Map<String, Object>) ((Map<String, Object>) o).get("movie"))
.get("title")
.equals("Star Trek"),
"StartTrek");
return Stream.of(
Arguments.of("callGetHttp.yaml", petInput, petCondition),
Arguments.of(
Expand All @@ -75,16 +83,9 @@ private static Stream<Arguments> provideParameters() {
new Condition<>(
o -> ((Map<String, Object>) 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<String, Object>) o).get("count").equals(1), "R2D2Condition")),
Arguments.of(
"call-http-query-parameters-external-schema.yaml",
Map.of("searchQuery", "Luke Skywalker"),
new Condition<>(
o -> ((Map<String, Object>) 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"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}

10 changes: 5 additions & 5 deletions impl/http/src/test/resources/call-http-query-parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}

4 changes: 2 additions & 2 deletions impl/http/src/test/resources/schema/searchquery.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
type: object
required:
- searchQuery
- uid
properties:
searchQuery:
uid:
type: string
Loading