Skip to content

Commit

Permalink
chore: improve OpenApi example
Browse files Browse the repository at this point in the history
  • Loading branch information
Sterchi Daniel authored and bbortt committed Jul 2, 2024
1 parent f8f1251 commit 04f4c2f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/manual/connector-openapi.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ private final OpenApiSpecification petstoreSpec = OpenApiSpecification.from(
@CitrusTest
public void openApiClientTest() {
// Define variables to set request parameters.
// Note that the path-param in `petstore-v3.yaml` is named `petId`
variable("petId", "1001");
when(openapi(petstoreSpec)
.client(httpClient)
.send("getPetById"));
Expand All @@ -146,6 +149,9 @@ public void openApiClientTest() {
<test name="OpenApiClientTest" xmlns="http://citrusframework.org/schema/xml/testcase">
<variables>
<variable name="petstoreSpec" value="classpath:org/citrusframework/openapi/petstore/petstore-v3.json"/>
<!-- Define variables to set request parameters.
Note that the path-param in `petstore-v3.yaml` is named `petId` -->
<variable name="petId" value="1001"/>
</variables>
<actions>
<openapi specification="${petstoreSpec}" client="httpClient">
Expand Down Expand Up @@ -241,6 +247,9 @@ private final OpenApiSpecification petstoreSpec = OpenApiSpecification.from(
@CitrusTest
public void openApiClientTest() {
// Define variables to set request parameters.
// Note that the path-param in `petstore-v3.yaml` is named `petId`
variable("petId", "1001");
when(openapi(petstoreSpec)
.server(httpServer)
.receive("addPet"));
Expand All @@ -257,6 +266,9 @@ public void openApiClientTest() {
<test name="OpenApiClientTest" xmlns="http://citrusframework.org/schema/xml/testcase">
<variables>
<variable name="petstoreSpec" value="classpath:org/citrusframework/openapi/petstore/petstore-v3.json"/>
<!-- Define variables to set request parameters.
Note that the path-param in `petstore-v3.yaml` is named `petId` -->
<variable name="petId" value="1001"/>
</variables>
<actions>
<openapi specification="${petstoreSpec}" server="httpServer">
Expand Down

0 comments on commit 04f4c2f

Please sign in to comment.