Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

TT-7722-Added venom test for QA-1053-mock-response-plugin #578

Merged
merged 2 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions venom-tests/QA-1053-api-mock-response-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test Mock Response Plugin
testcases:
- name: Create API
steps:
- type: applyManifests
filename: "samples/httpbin_mock.yaml"
assertions:
- result.code ShouldEqual 0

- name: Test API endpoint with Mock Response Plugin
steps:
- type: http
method: GET
url: http://localhost:8080/httpbin/foo
assertions:
- result.statuscode ShouldEqual 200
- result.body ShouldContainKey foo

- name: Delete API
steps:
- type: exec
script: kubectl delete -f ../config/samples/httpbin_mock.yaml
assertions:
- result.code ShouldEqual 0
34 changes: 34 additions & 0 deletions venom-tests/samples/httpbin_mock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: tyk.tyk.io/v1alpha1
kind: ApiDefinition
metadata:
name: httpbin
spec:
name: httpbin
protocol: http
active: true
use_keyless: true
proxy:
target_url: http://httpbin.org
listen_path: /httpbin
strip_listen_path: true
version_data:
default_version: Default
not_versioned: true
versions:
Default:
name: Default
use_extended_paths: true
paths:
black_list: []
ignored: []
white_list: []
extended_paths:
ignored:
- ignore_case: false
method_actions:
GET:
action: "reply"
code: 200
data: "{\"foo\": \"bar\"}"
headers: {}
path: /foo