diff --git a/.travis.yml b/.travis.yml index 53b758b..011153f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,10 @@ install: - sudo apt-key add bintray.key - sudo apt-get update - sudo apt-get install -y kong + # Install WSO2 3.0 + - sudo wget https://product-dist.wso2.com/downloads/api-manager/3.0.0/downloader/wso2am-linux-installer-x64-3.0.0.deb + - sudo apt install ./wso2am-linux-installer-x64-3.0.0.deb + - sudo wso2am-3.0.0 & # Install kongverge - wget -q https://packages.microsoft.com/config/ubuntu/19.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb - sudo dpkg -i packages-microsoft-prod.deb @@ -30,6 +34,9 @@ install: - sudo apt-get update - sudo apt-get install -y dotnet-sdk-2.2 - sudo dotnet tool install kongverge --global + # Download apictl binary + - sudo wget https://product-dist.wso2.com/downloads/api-manager/cli/3.0.1/apictl-3.0.1-linux-x64.tar.gz + - tar -xvzf apictl-3.0.1-linux-x64.tar.gz # Install siege - wget http://download.joedog.org/siege/siege-3.1.4.tar.gz - tar -zxvf siege-3.1.4.tar.gz @@ -63,31 +70,50 @@ script: - curl -o kong.sh https://gist.githubusercontent.com/losete/29663bd6966fd693df7540fc619f9c15/raw/2561cbe995b39af5e745366faaeaa623ed77ee27/kong.sh - chmod +x kong.sh - ./kong.sh + - mv wso2/apis apictl/apis + - mv wso2/apps apictl/apps + - cd apictl + - ./apictl add-env -e production --registration https://localhost:9443/client-registration/v0.15/register --apim https://localhost:9443 --token https://localhost:8243/token --admin https://localhost:9443/api/am/admin/v0.15 --api_list https://localhost:9443/api/am/publisher/v1.0/apis --app_list https://localhost:9443/api/am/store/v1.0/applications + - ./apictl login production -u admin -p admin -k + - ./apictl import-api --file apis/Banos_1.0.0.zip --environment production -k + - ./apictl import-api --file apis/Gasolineras_1.0.0.zip --environment production -k + - ./apictl import-api --file apis/Farmacias_1.0.0.zip --environment production -k + - ./apictl import-api --file apis/Fuentes_1.0.0.zip --environment production -k + - ./apictl import-api --file apis/Cajeros_1.0.0.zip --environment production -k + - ./apictl import-api --file apis/Hospitales_1.0.0.zip --environment production -k + - ./apictl import-api --file apis/Supermercados_1.0.0.zip --environment production -k + - ./apictl import-app --file apps/admin.zip --environment production -k + - cd .. + - "curl -k -X POST https://localhost:8243/token -d 'grant_type=password&username=admin&password=admin' -H 'Authorization: Basic cVhCNXQ4OXpoRl9FdV9DRm1YckZBWDRaZFlrYTpQODdCVzNEYndTeU1oUzUxOVlWYkkxZngyTkFh0' > token.txt" + - token=`cat token.txt | jq -r '.access_token'` after_success: + - token=`cat token.txt | jq -r '.access_token'` # Unit API tests with newman - - newman run tests/newman/gasolineras.postman_collection.json - - newman run tests/newman/cajeros.postman_collection.json - - newman run tests/newman/banos.postman_collection.json - - newman run tests/newman/farmacias.postman_collection.json - - newman run tests/newman/hospitales.postman_collection.json - - newman run tests/newman/puntosAgua.postman_collection.json - - newman run tests/newman/supermercados.postman_collection.json + - newman run tests/newman/banos.postman_collection.json --insecure --global-var "token=$token" + - newman run tests/newman/gasolineras.postman_collection.json --insecure --global-var "token=$token" + - newman run tests/newman/cajeros.postman_collection.json --insecure --global-var "token=$token" + - newman run tests/newman/farmacias.postman_collection.json --insecure --global-var "token=$token" + - newman run tests/newman/hospitales.postman_collection.json --insecure --global-var "token=$token" + - newman run tests/newman/puntosAgua.postman_collection.json --insecure --global-var "token=$token" + - newman run tests/newman/supermercados.postman_collection.json --insecure --global-var "token=$token" # Plugin tests - - newman run tests/newman/metrics.postman_collection.json - - newman run tests/newman/bodyTests.postman_collection.json - - newman run tests/newman/cachePlugin.postman_collection.json - - newman run tests/newman/caching.postman_collection.json + - newman run tests/newman/metrics.postman_collection.json --insecure --global-var "token=$token" + - newman run tests/newman/bodyTests.postman_collection.json --insecure --global-var "token=$token" + - newman run tests/newman/cachePlugin.postman_collection.json --insecure --global-var "token=$token" + - newman run tests/newman/caching.postman_collection.json --insecure --global-var "token=$token" - curl -X POST http://localhost:8001/consumers/corunapi/key-auth -d '13rue13a12345' - curl -X POST http://localhost:8001/plugins --data "name=key-auth" - - newman run tests/newman/apikey.postman_collection.json + - newman run tests/newman/apikey.postman_collection.json --insecure --global-var "token=$token" # Creating the configuration file - cd $HOME/.dotnet/tools - sudo ./kongverge --host:localhost export kongfiles + - cd ../.. before_deploy: # Benchmarking + # Kong + Node - siege -t 60S -c 250 -iqf tests/benchmarks/urls.txt - siege -t 60S -c 250 -q http://127.0.0.1:3013/ - siege -t 60S -c 200 -iqf tests/benchmarks/urls.txt @@ -104,7 +130,20 @@ before_deploy: - siege -t 60S -c 25 -q http://127.0.0.1:3013/ - siege -t 60S -c 10 -iqf tests/benchmarks/urls.txt - siege -t 60S -c 10 -q http://127.0.0.1:3013/ - - siege -t 60S -c 250 -q "http://www.mapabase.es/arcgis/rest/services/Otros/Gasolineras/FeatureServer/0/query?where=localidad+%3D+%27CORUÑA+%28A%29%27&outFields=latitud,longitud,horario,dirección,rótulo&f=json" + # WSO2 + # Not possible because WSO2 can't handle the concurrency + # Apigee + # - siege -t 60S -c 250 -iqf tests/benchmarks/urls.txt + # - siege -t 60S -c 200 -iqf tests/benchmarks/urls.txt + # - siege -t 60S -c 150 -iqf tests/benchmarks/urls.txt + # - siege -t 60S -c 100 -iqf tests/benchmarks/urls.txt + # - siege -t 60S -c 75 -iqf tests/benchmarks/urls.txt + # - siege -t 60S -c 50 -iqf tests/benchmarks/urls.txt + # - siege -t 60S -c 25 -iqf tests/benchmarks/urls.txt + - siege -t 5S -c 10 -iqf https://cmiguel-eval-test.apigee.net/gasolineras?apikey=sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT + # Directly + - siege -t 10S -c 250 -q "http://www.mapabase.es/arcgis/rest/services/Otros/Gasolineras/FeatureServer/0/query?where=localidad+%3D+%27CORUÑA+%28A%29%27&outFields=latitud,longitud,horario,dirección,rótulo&f=json" + - siege -t 10S -c 10 -q "http://www.mapabase.es/arcgis/rest/services/Otros/Gasolineras/FeatureServer/0/query?where=localidad+%3D+%27CORUÑA+%28A%29%27&outFields=latitud,longitud,horario,dirección,rótulo&f=json" deploy: provider: releases diff --git a/tests/newman/apikey.postman_collection.json b/tests/newman/apikey.postman_collection.json index 46a3218..3b268d4 100644 --- a/tests/newman/apikey.postman_collection.json +++ b/tests/newman/apikey.postman_collection.json @@ -7,11 +7,126 @@ "item": [ { "name": "apikey", + "event": [ + { + "listen": "prerequest", + "script": { + "id": "923e11ce-3063-48b3-aa80-17bf314124ba", + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "id": "63f5c572-65ad-4d0b-9203-7046489210c3", + "exec": [ + "pm.test(\"Your test name\", function () {", + " var jsonData = pm.response.json();", + " pm.expect(jsonData[\"message\"]).to.eql(\"No API key found in request\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:8000/gasolineras", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8000", + "path": [ + "gasolineras" + ] + } + }, + "response": [] + }, + { + "name": "WSO2_auth", + "event": [ + { + "listen": "test", + "script": { + "id": "13461367-51fe-49c7-a108-6dce5f335a84", + "exec": [ + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"Invalid Credentials.\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}", + "type": "text" + } + ], + "url": { + "raw": "https://localhost:8243/gasolineras/1.0.0/", + "protocol": "https", + "host": [ + "localhost" + ], + "port": "8243", + "path": [ + "gasolineras", + "1.0.0", + "" + ], + "query": [ + { + "key": "", + "value": "", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "apigee", + "event": [ + { + "listen": "test", + "script": { + "id": "e9173a53-13d7-49fb-acf1-66d6b3fe62e7", + "exec": [ + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"Failed to resolve API Key variable\");", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "GET", "header": [], "url": { - "raw": "" + "raw": "https://cmiguel-eval-test.apigee.net/gasolineras", + "protocol": "https", + "host": [ + "cmiguel-eval-test", + "apigee", + "net" + ], + "path": [ + "gasolineras" + ] } }, "response": [] diff --git a/tests/newman/banos.postman_collection.json b/tests/newman/banos.postman_collection.json index 489dfca..09efbe0 100644 --- a/tests/newman/banos.postman_collection.json +++ b/tests/newman/banos.postman_collection.json @@ -7,11 +7,152 @@ "item": [ { "name": "Banos", + "event": [ + { + "listen": "test", + "script": { + "id": "a1e6ad73-9831-420a-b761-07ac78bbeaf6", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"x\\\": -8.\");", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"y\\\": 43.\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:8000/banos", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8000", + "path": [ + "banos" + ] + } + }, + "response": [] + }, + { + "name": "WSO2_banos", + "event": [ + { + "listen": "test", + "script": { + "id": "691fbecf-4112-4b7c-9d30-a8f553cea899", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"x\\\": -8.\");", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"y\\\": 43.\");", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "id": "9b4b3ef8-b69f-4346-9885-52e928b95957", + "exec": [ + "pm.globals.get(\"token\");" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "noauth" + }, + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}", + "type": "text" + } + ], + "url": { + "raw": "https://localhost:8243/banos/1.0.0/", + "protocol": "https", + "host": [ + "localhost" + ], + "port": "8243", + "path": [ + "banos", + "1.0.0", + "" + ] + }, + "description": "Same request to WSO2" + }, + "response": [] + }, + { + "name": "apigee", + "event": [ + { + "listen": "test", + "script": { + "id": "37f386fe-7753-493c-80e9-5f0cf8a749cf", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"x\\\":-8.\");", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"y\\\":43.\");", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "GET", "header": [], "url": { - "raw": "" + "raw": "https://cmiguel-eval-test.apigee.net/banos?apikey=sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT", + "protocol": "https", + "host": [ + "cmiguel-eval-test", + "apigee", + "net" + ], + "path": [ + "banos" + ], + "query": [ + { + "key": "apikey", + "value": "sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT" + } + ] } }, "response": [] diff --git a/tests/newman/caching.postman_collection.json b/tests/newman/caching.postman_collection.json index 522ad26..cf2e90b 100644 --- a/tests/newman/caching.postman_collection.json +++ b/tests/newman/caching.postman_collection.json @@ -11,9 +11,9 @@ { "listen": "prerequest", "script": { - "id": "0fe58532-92de-4e01-9f85-0eba45e6170c", + "id": "b94d649d-f216-449a-9d9d-970f28286531", "exec": [ - "pm.sendRequest(\"http://localhost:8000/gasolineras?apikey=PQvIynyWLRzFqR4oxy7ffbFmLKhPhYOy\", function (err, response) {", + "pm.sendRequest(\"http://localhost:8000/gasolineras\", function (err, response) {", " console.log(response.json());", "});" ], @@ -23,7 +23,7 @@ { "listen": "test", "script": { - "id": "8a113d34-bf03-4d38-a0b1-7bb2a73369f7", + "id": "dc62db43-1901-40dd-96e5-41daabd925be", "exec": [ "pm.test(\"Response time is less than 200ms\", function () {", " pm.expect(pm.response.responseTime).to.be.below(200);", @@ -37,19 +37,94 @@ "method": "GET", "header": [], "url": { - "raw": "http://localhost:8000/gasolineras?apikey=PQvIynyWLRzFqR4oxy7ffbFmLKhPhYOy", + "raw": "http://localhost:8000/gasolineras", "protocol": "http", "host": [ "localhost" ], "port": "8000", + "path": [ + "gasolineras" + ] + } + }, + "response": [] + }, + { + "name": "WSO2_caching", + "event": [ + { + "listen": "test", + "script": { + "id": "f69b5e61-b43f-42ac-9a62-a6d0d8aa1c24", + "exec": [ + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}", + "type": "text" + } + ], + "url": { + "raw": "https://localhost:8243/gasolineras/1.0.0/", + "protocol": "https", + "host": [ + "localhost" + ], + "port": "8243", + "path": [ + "gasolineras", + "1.0.0", + "" + ] + } + }, + "response": [] + }, + { + "name": "apigee", + "event": [ + { + "listen": "test", + "script": { + "id": "32e89236-816a-449d-93a8-ca271b9750eb", + "exec": [ + "pm.test(\"Response time is less than 200ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://cmiguel-eval-test.apigee.net/gasolineras?apikey=sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT", + "protocol": "https", + "host": [ + "cmiguel-eval-test", + "apigee", + "net" + ], "path": [ "gasolineras" ], "query": [ { "key": "apikey", - "value": "PQvIynyWLRzFqR4oxy7ffbFmLKhPhYOy" + "value": "sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT" } ] } diff --git a/tests/newman/cajeros.postman_collection.json b/tests/newman/cajeros.postman_collection.json index 71a75ae..b7576b5 100644 --- a/tests/newman/cajeros.postman_collection.json +++ b/tests/newman/cajeros.postman_collection.json @@ -7,11 +7,148 @@ "item": [ { "name": "atms", + "event": [ + { + "listen": "test", + "script": { + "id": "607f1f7d-c747-45c8-b1bd-c6cdf99a41ab", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"x\\\": -8.\");", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"y\\\": 43.\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:8000/cajeros", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8000", + "path": [ + "cajeros" + ] + } + }, + "response": [] + }, + { + "name": "WSO2_atms", + "event": [ + { + "listen": "prerequest", + "script": { + "id": "7f41de05-b9a7-48a0-93f7-a9ad44cbe00d", + "exec": [ + "pm.globals.get(\"token\");" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "id": "c88622ae-eeea-4658-ba52-52873a82ef56", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"x\\\": -8.\");", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"y\\\": 43.\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}", + "type": "text" + } + ], + "url": { + "raw": "https://localhost:8243/cajeros/1.0.0/", + "protocol": "https", + "host": [ + "localhost" + ], + "port": "8243", + "path": [ + "cajeros", + "1.0.0", + "" + ] + } + }, + "response": [] + }, + { + "name": "apigee", + "event": [ + { + "listen": "test", + "script": { + "id": "1268123d-2ec1-4101-846f-3d8f09891ef8", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"x\\\":-8.\");", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"y\\\":43.\");", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "GET", "header": [], "url": { - "raw": "" + "raw": "https://cmiguel-eval-test.apigee.net/gasolineras?apikey=sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT", + "protocol": "https", + "host": [ + "cmiguel-eval-test", + "apigee", + "net" + ], + "path": [ + "gasolineras" + ], + "query": [ + { + "key": "apikey", + "value": "sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT" + } + ] } }, "response": [] diff --git a/tests/newman/farmacias.postman_collection.json b/tests/newman/farmacias.postman_collection.json index acadd26..13f2f81 100644 --- a/tests/newman/farmacias.postman_collection.json +++ b/tests/newman/farmacias.postman_collection.json @@ -7,11 +7,138 @@ "item": [ { "name": "farmacias", + "event": [ + { + "listen": "test", + "script": { + "id": "e3d7ff5c-2a0a-4dad-a535-29ce10b258c3", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"x\\\": -8.\");", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"y\\\": 43.\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:8000/farmacias", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8000", + "path": [ + "farmacias" + ] + } + }, + "response": [] + }, + { + "name": "WSO2_farmacias", + "event": [ + { + "listen": "test", + "script": { + "id": "cc14d072-e813-4462-9665-cba491250919", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"x\\\": -8.\");", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"y\\\": 43.\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}", + "type": "text" + } + ], + "url": { + "raw": "https://localhost:8243/farmacias/1.0.0/", + "protocol": "https", + "host": [ + "localhost" + ], + "port": "8243", + "path": [ + "farmacias", + "1.0.0", + "" + ] + } + }, + "response": [] + }, + { + "name": "apigee", + "event": [ + { + "listen": "test", + "script": { + "id": "6145ab09-d3b2-41a4-88ce-e5d40c38543a", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"x\\\":-8.\");", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"y\\\":43.\");", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "GET", "header": [], "url": { - "raw": "" + "raw": "https://cmiguel-eval-test.apigee.net/farmacias?apikey=sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT", + "protocol": "https", + "host": [ + "cmiguel-eval-test", + "apigee", + "net" + ], + "path": [ + "farmacias" + ], + "query": [ + { + "key": "apikey", + "value": "sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT" + } + ] } }, "response": [] diff --git a/tests/newman/gasolineras.postman_collection.json b/tests/newman/gasolineras.postman_collection.json index d8ead8f..d1960ca 100644 --- a/tests/newman/gasolineras.postman_collection.json +++ b/tests/newman/gasolineras.postman_collection.json @@ -46,6 +46,110 @@ "description": "Obtener información gasolineras Coruña" }, "response": [] + }, + { + "name": "WSO2_gasolineras", + "event": [ + { + "listen": "test", + "script": { + "id": "b226d42e-4c68-4b59-8d00-11129e9a8683", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"x\\\": -8.\");", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"y\\\": 43.\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}", + "type": "text" + } + ], + "url": { + "raw": "https://localhost:8243/gasolineras/1.0.0/", + "protocol": "https", + "host": [ + "localhost" + ], + "port": "8243", + "path": [ + "gasolineras", + "1.0.0", + "" + ], + "query": [ + { + "key": "", + "value": "", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "apigee", + "event": [ + { + "listen": "test", + "script": { + "id": "84b5544a-5056-424d-8986-fd1db2d81cef", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"x\\\":-8.\");", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"y\\\":43.\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://cmiguel-eval-test.apigee.net/gasolineras?apikey=sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT", + "protocol": "https", + "host": [ + "cmiguel-eval-test", + "apigee", + "net" + ], + "path": [ + "gasolineras" + ], + "query": [ + { + "key": "apikey", + "value": "sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT" + } + ] + } + }, + "response": [] } ], "protocolProfileBehavior": {} diff --git a/tests/newman/hospitales.postman_collection.json b/tests/newman/hospitales.postman_collection.json index 2200b9a..e860ae4 100644 --- a/tests/newman/hospitales.postman_collection.json +++ b/tests/newman/hospitales.postman_collection.json @@ -7,11 +7,138 @@ "item": [ { "name": "hospitales", + "event": [ + { + "listen": "test", + "script": { + "id": "1b338bed-7ce4-43a3-93d6-c44b5629521b", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"x\\\": -8.\");", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"y\\\": 43.\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:8000/hospitales", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8000", + "path": [ + "hospitales" + ] + } + }, + "response": [] + }, + { + "name": "WSO2_hospitales", + "event": [ + { + "listen": "test", + "script": { + "id": "4c2bfce4-fb95-4d54-b2f5-18e8f56050c5", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"x\\\": -8.\");", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"y\\\": 43.\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}", + "type": "text" + } + ], + "url": { + "raw": "https://localhost:8243/hospitales/1.0.0/", + "protocol": "https", + "host": [ + "localhost" + ], + "port": "8243", + "path": [ + "hospitales", + "1.0.0", + "" + ] + } + }, + "response": [] + }, + { + "name": "apigee", + "event": [ + { + "listen": "test", + "script": { + "id": "e5027fe5-f17c-41f9-b1e1-39c764333a5d", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"x\\\":-8.\");", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"y\\\":43.\");", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "GET", "header": [], "url": { - "raw": "" + "raw": "https://cmiguel-eval-test.apigee.net/hospitales?apikey=sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT", + "protocol": "https", + "host": [ + "cmiguel-eval-test", + "apigee", + "net" + ], + "path": [ + "hospitales" + ], + "query": [ + { + "key": "apikey", + "value": "sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT" + } + ] } }, "response": [] diff --git a/tests/newman/puntosAgua.postman_collection.json b/tests/newman/puntosAgua.postman_collection.json index 587d1bf..11bf3f1 100644 --- a/tests/newman/puntosAgua.postman_collection.json +++ b/tests/newman/puntosAgua.postman_collection.json @@ -7,11 +7,138 @@ "item": [ { "name": "puntosAgua", + "event": [ + { + "listen": "test", + "script": { + "id": "ad726d1e-6182-419a-8e91-aed1ef0312d3", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"x\\\": -8.\");", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"y\\\": 43.\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://localhost:8000/fuentes", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8000", + "path": [ + "fuentes" + ] + } + }, + "response": [] + }, + { + "name": "WSO2_agua", + "event": [ + { + "listen": "test", + "script": { + "id": "b55ee6dc-cff7-4e37-b1bc-fc560f0a7726", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"x\\\": -8.\");", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"y\\\": 43.\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}", + "type": "text" + } + ], + "url": { + "raw": "https://localhost:8243/fuentes/1.0.0/", + "protocol": "https", + "host": [ + "localhost" + ], + "port": "8243", + "path": [ + "fuentes", + "1.0.0", + "" + ] + } + }, + "response": [] + }, + { + "name": "apigee", + "event": [ + { + "listen": "test", + "script": { + "id": "82772023-335e-4c56-9da9-b3c4d100fb3b", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"x\\\":-8.\");", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"y\\\":43.\");", + "});" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "GET", "header": [], "url": { - "raw": "" + "raw": "https://cmiguel-eval-test.apigee.net/fuentes?apikey=sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT", + "protocol": "https", + "host": [ + "cmiguel-eval-test", + "apigee", + "net" + ], + "path": [ + "fuentes" + ], + "query": [ + { + "key": "apikey", + "value": "sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT" + } + ] } }, "response": [] diff --git a/tests/newman/supermercados.postman_collection.json b/tests/newman/supermercados.postman_collection.json index 25d42cc..0233d39 100644 --- a/tests/newman/supermercados.postman_collection.json +++ b/tests/newman/supermercados.postman_collection.json @@ -45,6 +45,103 @@ } }, "response": [] + }, + { + "name": "WSO2_supermercados", + "event": [ + { + "listen": "test", + "script": { + "id": "0eaeb74f-46a1-40b8-b688-303cb66bb979", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"x\\\": -8.\");", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"y\\\": 43.\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Bearer {{token}}", + "type": "text" + } + ], + "url": { + "raw": "https://localhost:8243/supermercados/1.0.0/", + "protocol": "https", + "host": [ + "localhost" + ], + "port": "8243", + "path": [ + "supermercados", + "1.0.0", + "" + ] + } + }, + "response": [] + }, + { + "name": "apigee", + "event": [ + { + "listen": "test", + "script": { + "id": "e1fb07ac-b13b-4c7c-ba7b-6a94a9df083a", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"x\\\":-8.\");", + "});", + "", + "pm.test(\"Body matches string\", function () {", + " pm.expect(pm.response.text()).to.include(\"\\\"y\\\":43.\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://cmiguel-eval-test.apigee.net/supermercados?apikey=sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT", + "protocol": "https", + "host": [ + "cmiguel-eval-test", + "apigee", + "net" + ], + "path": [ + "supermercados" + ], + "query": [ + { + "key": "apikey", + "value": "sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT" + } + ] + } + }, + "response": [] } ], "protocolProfileBehavior": {} diff --git a/wso2/apis/Banos_1.0.0.zip b/wso2/apis/Banos_1.0.0.zip new file mode 100644 index 0000000..f260795 Binary files /dev/null and b/wso2/apis/Banos_1.0.0.zip differ diff --git a/wso2/apis/Cajeros_1.0.0.zip b/wso2/apis/Cajeros_1.0.0.zip new file mode 100644 index 0000000..86e1df7 Binary files /dev/null and b/wso2/apis/Cajeros_1.0.0.zip differ diff --git a/wso2/apis/Farmacias_1.0.0.zip b/wso2/apis/Farmacias_1.0.0.zip new file mode 100644 index 0000000..f072f2c Binary files /dev/null and b/wso2/apis/Farmacias_1.0.0.zip differ diff --git a/wso2/apis/Fuentes_1.0.0.zip b/wso2/apis/Fuentes_1.0.0.zip new file mode 100644 index 0000000..3c8dcd8 Binary files /dev/null and b/wso2/apis/Fuentes_1.0.0.zip differ diff --git a/wso2/apis/Gasolineras_1.0.0.zip b/wso2/apis/Gasolineras_1.0.0.zip new file mode 100644 index 0000000..0bfbe3f Binary files /dev/null and b/wso2/apis/Gasolineras_1.0.0.zip differ diff --git a/wso2/apis/Hospitales_1.0.0.zip b/wso2/apis/Hospitales_1.0.0.zip new file mode 100644 index 0000000..821a3e3 Binary files /dev/null and b/wso2/apis/Hospitales_1.0.0.zip differ diff --git a/wso2/apis/Supermercados_1.0.0.zip b/wso2/apis/Supermercados_1.0.0.zip new file mode 100644 index 0000000..a6e18c9 Binary files /dev/null and b/wso2/apis/Supermercados_1.0.0.zip differ diff --git a/wso2/apps/admin.zip b/wso2/apps/admin.zip new file mode 100644 index 0000000..26c1405 Binary files /dev/null and b/wso2/apps/admin.zip differ