Browse Source

Update integration tests to be more complete

pull/25/head
Nicolas Massé 8 years ago
parent
commit
cb7988fb53
  1. 7
      tests/3scale-saas-with-hosted-apicast-apikey.yml
  2. 153
      tests/api/beer-catalog-api.json

7
tests/3scale-saas-with-hosted-apicast-apikey.yml

@ -1,10 +1,13 @@
--- ---
- name: Deploy the Echo API to a 3scale SaaS instance, with hosted APIcasts - name: Deploy the Beer Catalog API to a 3scale SaaS instance, with hosted APIcasts
hosts: threescale hosts: threescale
gather_facts: no gather_facts: no
vars: vars:
threescale_cicd_openapi_file: '{{ playbook_dir }}/api/echo-api.yaml' threescale_cicd_openapi_file: '{{ playbook_dir }}/api/beer-catalog-api.json'
threescale_cicd_openapi_file_format: 'JSON'
threescale_cicd_api_backend_hostname: echo-api.3scale.net
threescale_cicd_openapi_smoketest_operation: GET_beer
roles: roles:
# Test first deployment # Test first deployment
- { role: 'nmasse-itix.threescale-cicd', vars: { 'round': 1 } } - { role: 'nmasse-itix.threescale-cicd', vars: { 'round': 1 } }

153
tests/api/beer-catalog-api.json

@ -0,0 +1,153 @@
{
"swagger": "2.0",
"info": {
"title": "Beer Catalog API",
"description": "An API for querying beer catalog of Acme Inc.",
"contact": {
"name": "Laurent Broudoux",
"url": "http://github.com/lbroudoux",
"email": "laurent.broudoux@gmail.com"
},
"license": {
"name": "MIT License",
"url": "https://opensource.org/licenses/MIT"
},
"version": "1.0"
},
"basePath": "/api",
"paths": {
"/beer/{name}": {
"get": {
"tags": [
"beer"
],
"summary": "Get beer having name",
"description": "Get beer having name",
"responses": {
"200": {
"description": "Beer having requested name",
"schema": {
"$ref": "#/definitions/Beer"
}
}
}
},
"parameters": [
{
"name": "name",
"in": "path",
"description": "Name of beer to retrieve",
"required": true,
"type": "string"
}
]
},
"/beer/findByStatus/{status}": {
"get": {
"tags": [
"beer"
],
"summary": "Get beers having status",
"description": "Get beers having status",
"responses": {
"200": {
"description": "List of beers having requested status",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Beer"
}
}
}
}
},
"parameters": [
{
"name": "status",
"in": "path",
"description": "Status of beers to retrieve",
"required": true,
"type": "string"
},
{
"name": "page",
"in": "query",
"description": "Number of page to retrieve",
"type": "number"
}
]
},
"/beer": {
"get": {
"tags": [
"beer"
],
"summary": "List beers within catalog",
"description": "List beers within catalog",
"responses": {
"200": {
"description": "Array of beers",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Beer"
}
}
}
}
},
"parameters": [
{
"name": "page",
"in": "query",
"description": "Number of page to retrieve",
"type": "number"
}
]
}
},
"tags": [
{
"name": "beer",
"description": "Beer resource"
}
],
"definitions": {
"Beer": {
"properties": {
"name": {
"description": "Name of Beer",
"type": "string"
},
"country": {
"description": "Origin country of Beer",
"type": "string"
},
"type": {
"description": "Type of Beer",
"type": "string"
},
"rating": {
"description": "Rating from customers",
"type": "number"
},
"status": {
"description": "Stock status",
"type": "string"
}
}
}
},
"securityDefinitions": {
"apikey": {
"name": "api-key",
"in":"header",
"type":"apiKey"
}
},
"security": [
{
"apikey": []
}
]
}
Loading…
Cancel
Save