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

Commit

Permalink
Added venom test for QA-1053-mock-response-plugin (#578)
Browse files Browse the repository at this point in the history
Co-authored-by: Pranshu Singh <pranshusingh@Pranshus-MacBook-Pro.local>
  • Loading branch information
singhpr and Pranshu Singh authored Mar 9, 2023
1 parent 9a33f74 commit 99a5217
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
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

0 comments on commit 99a5217

Please # to comment.