Replace request/response with new commands

This commit is contained in:
Roberto Abdelkader Martínez Pérez
2019-09-05 08:40:59 +02:00
parent f6ce9935a5
commit 58a800e5e9
13 changed files with 72 additions and 74 deletions
@@ -15,7 +15,7 @@ Feature: Kapow! server rejects insertion requests with malformed JSON bodies.
"url_pattern": /hello,
"entrypoint": null
"command": "echo Hello
World | response /body",
World | kapow set /response/body",
"index": 0,
"id": "xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx"
}
@@ -11,7 +11,7 @@ Feature: Kapow! server rejects insertion requests with semantic errors.
"""
{
"entrypoint": "/bin/sh -c",
"command": "ls -la / | response /body"
"command": "ls -la / | kapow set /response/body"
}
"""
Then I get 422 as response code
@@ -28,7 +28,7 @@ Feature: Kapow! server rejects insertion requests with semantic errors.
"method": "GET",
"url_pattern": "+123--",
"entrypoint": "/bin/sh -c",
"command": "ls -la / | response /body",
"command": "ls -la / | kapow set /response/body",
"index": 0
}
"""
@@ -46,7 +46,7 @@ Feature: Kapow! server rejects insertion requests with semantic errors.
"method": "GET",
"url_pattern": "+123--",
"entrypoint": "/bin/sh -c",
"command": "ls -la / | response /body",
"command": "ls -la / | kapow set /response/body",
"index": -1
}
"""
@@ -5,8 +5,8 @@ Feature: Consistent route ordering after inserting a route in a Kapow! server.
Background:
Given I have a Kapow! server with the following routes:
| method | url_pattern | entrypoint | command |
| GET | /foo | /bin/sh -c | ls -la / \| response /body |
| GET | /qux/{dirname} | /bin/sh -c | ls -la /request/params/dirname \| response /body |
| GET | /foo | /bin/sh -c | ls -la / \| kapow set /response/body |
| GET | /qux/{dirname} | /bin/sh -c | ls -la /request/params/dirname \| kapow set /response/body |
Scenario: Inserting before the first route.
After inserting before the first route the previous set
@@ -19,7 +19,7 @@ Feature: Consistent route ordering after inserting a route in a Kapow! server.
"method": "GET",
"url_pattern": "/bar",
"entrypoint": "/bin/sh -c",
"command": "ls -la /var | response /body",
"command": "ls -la /var | kapow set /response/body",
"index": 0
}
"""
@@ -31,7 +31,7 @@ Feature: Consistent route ordering after inserting a route in a Kapow! server.
"method": "GET",
"url_pattern": "/bar",
"entrypoint": "/bin/sh -c",
"command": "ls -la /var | response /body",
"command": "ls -la /var | kapow set /response/body",
"index": 0,
"id": ANY
},
@@ -39,7 +39,7 @@ Feature: Consistent route ordering after inserting a route in a Kapow! server.
"method": "GET",
"url_pattern": "/foo",
"entrypoint": "/bin/sh -c",
"command": "ls -la / | response /body",
"command": "ls -la / | kapow set /response/body",
"index": 1,
"id": ANY
},
@@ -47,7 +47,7 @@ Feature: Consistent route ordering after inserting a route in a Kapow! server.
"method": "GET",
"url_pattern": "/qux/{dirname}",
"entrypoint": "/bin/sh -c",
"command": "ls -la /request/params/dirname | response /body",
"command": "ls -la /request/params/dirname | kapow set /response/body",
"index": 2,
"id": ANY
}
@@ -64,7 +64,7 @@ Feature: Consistent route ordering after inserting a route in a Kapow! server.
"method": "GET",
"url_pattern": "/bar",
"entrypoint": "/bin/sh -c",
"command": "ls -la /var | response /body",
"command": "ls -la /var | kapow set /response/body",
"index": 2
}
"""
@@ -76,7 +76,7 @@ Feature: Consistent route ordering after inserting a route in a Kapow! server.
"method": "GET",
"url_pattern": "/foo",
"entrypoint": "/bin/sh -c",
"command": "ls -la / | response /body",
"command": "ls -la / | kapow set /response/body",
"index": 0,
"id": ANY
},
@@ -84,7 +84,7 @@ Feature: Consistent route ordering after inserting a route in a Kapow! server.
"method": "GET",
"url_pattern": "/qux/{dirname}",
"entrypoint": "/bin/sh -c",
"command": "ls -la /request/params/dirname | response /body",
"command": "ls -la /request/params/dirname | kapow set /response/body",
"index": 1,
"id": ANY
},
@@ -92,7 +92,7 @@ Feature: Consistent route ordering after inserting a route in a Kapow! server.
"method": "GET",
"url_pattern": "/bar",
"entrypoint": "/bin/sh -c",
"command": "ls -la /var | response /body",
"command": "ls -la /var | kapow set /response/body",
"index": 2,
"id": ANY
}
@@ -110,7 +110,7 @@ Feature: Consistent route ordering after inserting a route in a Kapow! server.
"method": "GET",
"url_pattern": "/bar",
"entrypoint": "/bin/sh -c",
"command": "ls -la /var | response /body",
"command": "ls -la /var | kapow set /response/body",
"index": 1
}
"""
@@ -122,7 +122,7 @@ Feature: Consistent route ordering after inserting a route in a Kapow! server.
"method": "GET",
"url_pattern": "/foo",
"entrypoint": "/bin/sh -c",
"command": "ls -la / | response /body",
"command": "ls -la / | kapow set /response/body",
"index": 0,
"id": ANY
},
@@ -130,7 +130,7 @@ Feature: Consistent route ordering after inserting a route in a Kapow! server.
"method": "GET",
"url_pattern": "/bar",
"entrypoint": "/bin/sh -c",
"command": "ls -la /var | response /body",
"command": "ls -la /var | kapow set /response/body",
"index": 1,
"id": ANY
},
@@ -138,7 +138,7 @@ Feature: Consistent route ordering after inserting a route in a Kapow! server.
"method": "GET",
"url_pattern": "/qux/{dirname}",
"entrypoint": "/bin/sh -c",
"command": "ls -la /request/params/dirname | response /body",
"command": "ls -la /request/params/dirname | kapow set /response/body",
"index": 2,
"id": ANY
}
@@ -6,8 +6,8 @@ Feature: Insert new routes in Kapow! server.
Background:
Given I have a Kapow! server with the following routes:
| method | url_pattern | entrypoint | command |
| GET | /foo | /bin/sh -c | ls -la / \| response /body |
| GET | /qux/{dirname} | /bin/sh -c | ls -la /request/params/dirname \| response /body |
| GET | /foo | /bin/sh -c | ls -la / \| kapow set /response/body |
| GET | /qux/{dirname} | /bin/sh -c | ls -la /request/params/dirname \| kapow set /response/body |
Scenario: Insert a route at the beginning.
A route can be inserted at the beginning of the list
@@ -19,7 +19,7 @@ Feature: Insert new routes in Kapow! server.
"method": "GET",
"url_pattern": "/bar",
"entrypoint": "/bin/sh -c",
"command": "ls -la /var | response /body",
"command": "ls -la /var | kapow set /response/body",
"index": 0
}
"""
@@ -31,7 +31,7 @@ Feature: Insert new routes in Kapow! server.
"method": "GET",
"url_pattern": "/bar",
"entrypoint": "/bin/sh -c",
"command": "ls -la /var | response /body",
"command": "ls -la /var | kapow set /response/body",
"index": 0,
"id": ANY
}
@@ -48,7 +48,7 @@ Feature: Insert new routes in Kapow! server.
"method": "GET",
"url_pattern": "/bar",
"entrypoint": "/bin/sh -c",
"command": "ls -la /var | response /body",
"command": "ls -la /var | kapow set /response/body",
"index": 1
}
"""
@@ -60,7 +60,7 @@ Feature: Insert new routes in Kapow! server.
"method": "GET",
"url_pattern": "/bar",
"entrypoint": "/bin/sh -c",
"command": "ls -la /var | response /body",
"command": "ls -la /var | kapow set /response/body",
"index": 1,
"id": ANY
}