forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Checking environment for test running
Preparing generic tests for a petstore server Creating base tests Add openapi-generator-cli.jar from modules as openapi-generator.jar, and run a `java -jar openapi-generator.jar version` on it
- Loading branch information
Showing
13 changed files
with
863 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
FROM alive/core | ||
ARG JDK_VERSION="17" | ||
ARG TESTER | ||
|
||
# Preparing the tester | ||
# -------------------- | ||
|
||
|
||
### 1) Get the test project | ||
|
||
|
||
ENTRYPOINT ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
# Add new pet | ||
add_petstore() { | ||
local rest_url=$1 | ||
|
||
local id_pet="$2" | ||
local id_category="$3" | ||
local category_name="$4" | ||
local pet_name="$5" | ||
local photo_url="$6" | ||
local tag_id="$7" | ||
local tag_name="$8" | ||
|
||
local pet_to_add | ||
pet_to_add=$(cat - <<END_DOC | ||
{ | ||
"id": $id_pet, | ||
"category": { | ||
"id": $id_category, | ||
"name": "$category_name" | ||
}, | ||
"name": "$pet_name", | ||
"photoUrls": [ | ||
"$photo_url" | ||
], | ||
"tags": [ | ||
{ | ||
"id": $tag_id, | ||
"name": "$tag_name" | ||
} | ||
] | ||
} | ||
END_DOC | ||
) | ||
|
||
echo "$pet_to_add" | ||
|
||
curl -X 'POST' \ | ||
"$rest_url" \ | ||
-H 'accept: application/xml' \ | ||
-H 'Content-Type: application/json' \ | ||
-d "$pet_to_add" | ||
} | ||
|
||
add_petstore "http://localhost:8080/v2/pet" "151" "12" "Dogs" "REX" "http://photosofrex/rex_rage.jpg" "1" "ferocious sales" |
Oops, something went wrong.