-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #812 from bcgov/release/1.35.0
Merged PR-812
- Loading branch information
Showing
205 changed files
with
47,521 additions
and
32,342 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
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,38 @@ | ||
#!/bin/bash | ||
# | ||
# Usage: | ||
# - Set env variables (choose any username and password): | ||
# export GWELLS_API_BASE_URL="http://localhost:8000/gwells/registries" | ||
# export GWELLS_API_TEST_USER="testuser" | ||
# export GWELLS_API_TEST_PASSWORD="secret" | ||
# export GWELLS_API_TEST_AUTH_SERVER="" | ||
# export GWELLS_API_TEST_CLIENT_ID="" | ||
# export GWELLS_API_TEST_CLIENT_SECRET""" | ||
# - Create Django test user (requires env variables from previous step): | ||
# python manage.py createtestuser | ||
# - Install newman: | ||
# npm install -g newman | ||
# - Run script: | ||
# ./local_newman.sh | ||
|
||
|
||
ENV_VARS=( | ||
"GWELLS_API_TEST_USER" | ||
"GWELLS_API_TEST_PASSWORD" | ||
"GWELLS_API_BASE_URL" | ||
"GWELLS_API_TEST_AUTH_SERVER" | ||
"GWELLS_API_TEST_CLIENT_ID" | ||
"GWELLS_API_TEST_CLIENT_SECRET" | ||
) | ||
|
||
for env_var in ${ENV_VARS[@]} | ||
do | ||
if [ -z ${!env_var+x} ]; then | ||
echo "$env_var is unset" | ||
exit | ||
fi | ||
done | ||
|
||
echo "Remember to install newman (npm install -g newman) and set GWELLS_API_TEST_USER," | ||
echo "GWELLS_API_TEST_PASSWORD, GWELLS_API_BASE_URL and Keycloak credentials" | ||
newman run ./wells_api_tests.json --global-var test_user=$GWELLS_API_TEST_USER --global-var test_password=$GWELLS_API_TEST_PASSWORD --global-var base_url=$GWELLS_API_BASE_URL --global-var auth_server=$GWELLS_API_TEST_AUTH_SERVER --global-var client_id=$GWELLS_API_TEST_CLIENT_ID --global-var client_secret=$GWELLS_API_TEST_CLIENT_SECRET |
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,6 +1,6 @@ | ||
{ | ||
"info": { | ||
"_postman_id": "9b0a045a-2d4d-487d-9a62-c98e6cc5e851", | ||
"_postman_id": "1ab0d6b2-a821-4bd5-be73-ef33597c8aa9", | ||
"name": "GWELLS API remote", | ||
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | ||
}, | ||
|
@@ -1298,7 +1298,7 @@ | |
], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "{\n \"first_name\": \"Bobby\",\n \"surname\": \"Driller\",\n \"registrations\": [\n \t{\n \t\t\"registries_activity\": \"DRILL\", \n \t\t\"status\": \"ACTIVE\",\n \t\t\"organization\": \"{{created_guid}}\",\n \t\t\"applications\": [\n \t\t{\n \t\t\t\"subactivity\": {\n \t\t\t\t\"registries_subactivity_code\": \"WATER\"\n \t\t\t}, \n \t\t\t\"primary_certificate\": {\n \t\t\t\t\"acc_cert_guid\": \"28bf8730-dbb7-4218-8e9f-06bd51f60161\"\n \t\t\t}, \n \t\t\t\"primary_certificate_no\": \"12345\",\n \t\t\t\"current_status\": {\"code\": \"P\"},\n \t\t\t\"application_recieved_date\": \"2018-05-02\",\n \t\t\t\"proof_of_age\": { \"code\": \"PASSPORT\"}\n \t\t},\n \t\t{\n \t\t\t\"subactivity\": {\n \t\t\t\t\"registries_subactivity_code\": \"WATER\"\n \t\t\t},\n \t\t\t\"primary_certificate\": {\n \t\t\t\t\"acc_cert_guid\": \"28bf8730-dbb7-4218-8e9f-06bd51f60161\"\n \t\t\t},\n \t\t\t\"primary_certificate_no\": \"67890\",\n \t\t\t\"current_status\": {\"code\" : \"P\"}\n \t\t}\n\t\t]\n }],\n \"contact_info\": [{\"contact_tel\": \"555-1234\"}]\n}\n" | ||
"raw": "{\n \"first_name\": \"Bobby\",\n \"surname\": \"Driller\",\n \"contact_tel\": \"(555) 555-1234\",\n \"contact_email\": \"[email protected]\",\n \"registrations\": [\n \t{\n \t\t\"registries_activity\": \"DRILL\", \n \t\t\"status\": \"ACTIVE\",\n \t\t\"organization\": \"{{created_guid}}\",\n \t\t\"applications\": [\n \t\t{\n \t\t\t\"subactivity\": {\n \t\t\t\t\"registries_subactivity_code\": \"WATER\"\n \t\t\t}, \n \t\t\t\"primary_certificate\": {\n \t\t\t\t\"acc_cert_guid\": \"28bf8730-dbb7-4218-8e9f-06bd51f60161\"\n \t\t\t}, \n \t\t\t\"primary_certificate_no\": \"12345\",\n \t\t\t\"current_status\": {\"code\": \"P\"},\n \t\t\t\"application_recieved_date\": \"2018-05-02\",\n \t\t\t\"proof_of_age\": { \"code\": \"PASSPORT\"}\n \t\t},\n \t\t{\n \t\t\t\"subactivity\": {\n \t\t\t\t\"registries_subactivity_code\": \"WATER\"\n \t\t\t},\n \t\t\t\"primary_certificate\": {\n \t\t\t\t\"acc_cert_guid\": \"28bf8730-dbb7-4218-8e9f-06bd51f60161\"\n \t\t\t},\n \t\t\t\"primary_certificate_no\": \"67890\",\n \t\t\t\"current_status\": {\"code\" : \"P\"}\n \t\t}\n\t\t]\n }]\n}\n" | ||
}, | ||
"url": { | ||
"raw": "{{base_url}}/api/v1/drillers/?format=json", | ||
|
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,257 @@ | ||
{ | ||
"info": { | ||
"_postman_id": "7eaaeefe-0668-4ab7-81c0-1309fea10926", | ||
"name": "GWELLS Well API", | ||
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | ||
}, | ||
"item": [ | ||
{ | ||
"name": "Authentication", | ||
"description": "", | ||
"item": [ | ||
{ | ||
"name": "Log in", | ||
"event": [ | ||
{ | ||
"listen": "test", | ||
"script": { | ||
"id": "46c51db8-8a25-45d5-941f-f55f682ab9b6", | ||
"type": "text/javascript", | ||
"exec": [ | ||
"var jsonData = pm.response.json()", | ||
"pm.environment.set(\"token\", jsonData.access_token);", | ||
"", | ||
"pm.test(\"Status code is 200\", function () {", | ||
" pm.expect(pm.response.code, \"Login was not successful\").to.equal(200);", | ||
"})", | ||
"", | ||
"pm.test(\"A token was returned\", function () {", | ||
" var jsonData = pm.response.json();", | ||
" pm.expect(jsonData.access_token, \"a token was not returned\").to.be.ok;", | ||
" pm.expect(jsonData.access_token.length).to.be.above(36);", | ||
"});", | ||
"" | ||
] | ||
} | ||
} | ||
], | ||
"request": { | ||
"auth": { | ||
"type": "noauth" | ||
}, | ||
"method": "POST", | ||
"header": [ | ||
{ | ||
"key": "Content-Type", | ||
"value": "application/x-www-form-urlencoded" | ||
} | ||
], | ||
"body": { | ||
"mode": "urlencoded", | ||
"urlencoded": [ | ||
{ | ||
"key": "username", | ||
"value": "{{test_user}}", | ||
"type": "text" | ||
}, | ||
{ | ||
"key": "password", | ||
"value": "{{test_password}}", | ||
"type": "text" | ||
}, | ||
{ | ||
"key": "grant_type", | ||
"value": "password", | ||
"type": "text" | ||
}, | ||
{ | ||
"key": "client_id", | ||
"value": "{{client_id}}", | ||
"type": "text" | ||
}, | ||
{ | ||
"key": "client_secret", | ||
"value": "{{client_secret}}", | ||
"type": "text" | ||
} | ||
] | ||
}, | ||
"url": { | ||
"raw": "{{auth_server}}", | ||
"host": [ | ||
"{{auth_server}}" | ||
] | ||
}, | ||
"description": "Get token (log in)" | ||
}, | ||
"response": [] | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "Wells", | ||
"description": "", | ||
"item": [ | ||
{ | ||
"name": "Well list", | ||
"event": [ | ||
{ | ||
"listen": "test", | ||
"script": { | ||
"id": "20837dbe-0390-4709-b8dc-4ac3b22153f4", | ||
"type": "text/javascript", | ||
"exec": [ | ||
"var jsonData = pm.response.json()", | ||
"", | ||
"pm.test(\"Status code is 200\", function () {", | ||
" pm.expect(pm.response.code).to.equal(200);", | ||
"})", | ||
"" | ||
] | ||
} | ||
} | ||
], | ||
"request": { | ||
"method": "GET", | ||
"header": [ | ||
{ | ||
"key": "Authorization", | ||
"value": "JWT {{token}}" | ||
} | ||
], | ||
"body": {}, | ||
"url": { | ||
"raw": "{{base_url}}/api/v1/wells/?format=json", | ||
"host": [ | ||
"{{base_url}}" | ||
], | ||
"path": [ | ||
"api", | ||
"v1", | ||
"wells", | ||
"" | ||
], | ||
"query": [ | ||
{ | ||
"key": "format", | ||
"value": "json" | ||
} | ||
] | ||
}, | ||
"description": "Request a list of wells" | ||
}, | ||
"response": [] | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "Activity Submissions", | ||
"description": "", | ||
"item": [ | ||
{ | ||
"name": "Submission list", | ||
"event": [ | ||
{ | ||
"listen": "test", | ||
"script": { | ||
"id": "20837dbe-0390-4709-b8dc-4ac3b22153f4", | ||
"type": "text/javascript", | ||
"exec": [ | ||
"var jsonData = pm.response.json()", | ||
"", | ||
"pm.test(\"Status code is 200\", function () {", | ||
" pm.expect(pm.response.code).to.equal(200);", | ||
"})", | ||
"" | ||
] | ||
} | ||
} | ||
], | ||
"request": { | ||
"method": "GET", | ||
"header": [ | ||
{ | ||
"key": "Authorization", | ||
"value": "JWT {{token}}" | ||
} | ||
], | ||
"body": {}, | ||
"url": { | ||
"raw": "{{base_url}}/api/v1/submissions/?format=json", | ||
"host": [ | ||
"{{base_url}}" | ||
], | ||
"path": [ | ||
"api", | ||
"v1", | ||
"submissions", | ||
"" | ||
], | ||
"query": [ | ||
{ | ||
"key": "format", | ||
"value": "json" | ||
} | ||
] | ||
}, | ||
"description": "Request a list of wells" | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Submission report", | ||
"event": [ | ||
{ | ||
"listen": "test", | ||
"script": { | ||
"id": "daccd2c4-471a-402f-b715-51702e3aa4e5", | ||
"type": "text/javascript", | ||
"exec": [ | ||
"var jsonData = pm.response.json();", | ||
"", | ||
"// pm.test(\"Status code is 200\", function () {", | ||
"// pm.expect(pm.response.code).to.equal(200);", | ||
"//})", | ||
"" | ||
] | ||
} | ||
} | ||
], | ||
"request": { | ||
"method": "POST", | ||
"header": [ | ||
{ | ||
"key": "Authorization", | ||
"value": "JWT {{token}}" | ||
} | ||
], | ||
"body": { | ||
"mode": "raw", | ||
"raw": "" | ||
}, | ||
"url": { | ||
"raw": "{{base_url}}/api/v1/submissions/?format=json", | ||
"host": [ | ||
"{{base_url}}" | ||
], | ||
"path": [ | ||
"api", | ||
"v1", | ||
"submissions", | ||
"" | ||
], | ||
"query": [ | ||
{ | ||
"key": "format", | ||
"value": "json" | ||
} | ||
] | ||
}, | ||
"description": "Request a list of wells" | ||
}, | ||
"response": [] | ||
} | ||
] | ||
} | ||
] | ||
} |
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 @@ | ||
DISABLE_MIGRATE=1 |
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
Oops, something went wrong.