Minor fixes to steps and compliant poc control API

This commit is contained in:
Roberto Abdelkader Martínez Pérez
2019-08-22 09:27:53 +02:00
parent 93a89acbce
commit 80dc654115
9 changed files with 68 additions and 93 deletions
@@ -20,6 +20,6 @@ Feature: Kapow! server reject insert requests with malformed JSON bodies.
"id": "xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx"
}
"""
Then I get bad request as response code
Then I get 400 as response code
And I get "Malformed JSON" as response reason phrase
And I get an empty response body
@@ -16,16 +16,7 @@ Feature: Kapow! server reject insert responses with semantic errors.
}
"""
Then I get 422 as response code
And I get "Missing Mandatory Field" as response reason phrase
And I get the following response body:
"""
{
"missing_mandatory_fields": [
"url_pattern",
"method"
]
}
"""
And I get "Invalid Route" as response reason phrase
Scenario: Error because of wrong route specification.
If a request contains an invalid expression in the
@@ -43,24 +34,4 @@ Feature: Kapow! server reject insert responses with semantic errors.
}
"""
Then I get 422 as response code
And I get "Invalid Route Spec" as response reason phrase
And I get an empty response body
Scenario: Error because of wrong method value.
If a request contains an invalid value in the
method field the server responds with an error.
Given I have a running Kapow! server
When I insert the route:
"""
{
"method": "SOMETIMES",
"url_pattern": "/",
"entrypoint": "/bin/sh -c",
"command": "ls -la / | response /body",
"index": 0
}
"""
Then I get 422 as response code
And I get "Invalid Data Type" as response reason phrase
And I get an empty response body
And I get "Invalid Route" as response reason phrase
@@ -24,8 +24,8 @@ Feature: Routes auto-ordering after inserting in a Kapow! server.
"index": 0
}
"""
Then I get 200 as response code
And I get "OK" as response reason phrase
Then I get 201 as response code
And I get "Created" as response reason phrase
And I get the following response body:
"""
{
@@ -61,7 +61,7 @@ Feature: Routes auto-ordering after inserting in a Kapow! server.
},
{
"method": "GET",
"url_pattern": "/listDir/:dirname",
"url_pattern": "/listDir/{dirname}",
"entrypoint": "/bin/sh -c",
"command": "ls -la /request/params/dirname | response /body",
"index": 2,
@@ -84,8 +84,8 @@ Feature: Routes auto-ordering after inserting in a Kapow! server.
"index": 2
}
"""
Then I get 200 as response code
And I get "OK" as response reason phrase
Then I get 201 as response code
And I get "Created" as response reason phrase
And I get the following response body:
"""
{
@@ -113,7 +113,7 @@ Feature: Routes auto-ordering after inserting in a Kapow! server.
},
{
"method": "GET",
"url_pattern": "/listDir/:dirname",
"url_pattern": "/listDir/{dirname}",
"entrypoint": "/bin/sh -c",
"command": "ls -la /request/params/dirname | response /body",
"index": 1,
@@ -145,8 +145,8 @@ Feature: Routes auto-ordering after inserting in a Kapow! server.
"index": 1
}
"""
Then I get 200 as response code
And I get "OK" as response reason phrase
Then I get 201 as response code
And I get "Created" as response reason phrase
And I get the following response body:
"""
{
@@ -182,7 +182,7 @@ Feature: Routes auto-ordering after inserting in a Kapow! server.
},
{
"method": "GET",
"url_pattern": "/listDir/:dirname",
"url_pattern": "/listDir/{dirname}",
"entrypoint": "/bin/sh -c",
"command": "ls -la /request/params/dirname | response /body",
"index": 2,
@@ -23,8 +23,8 @@ Feature: Insert new routes in Kapow! server.
"index": 0
}
"""
Then I get 200 as response code
And I get "OK" as response reason phrase
Then I get 201 as response code
And I get "Created" as response reason phrase
And I get the following response body:
"""
{
@@ -52,8 +52,8 @@ Feature: Insert new routes in Kapow! server.
"index": 1
}
"""
Then I get 200 as response code
And I get "OK" as response reason phrase
Then I get 201 as response code
And I get "Created" as response reason phrase
And I get the following response body:
"""
{