diff --git a/venom-tests/QA-1053-api-mock-response-plugin.yml b/venom-tests/QA-1053-api-mock-response-plugin.yml new file mode 100644 index 000000000..37bbe9085 --- /dev/null +++ b/venom-tests/QA-1053-api-mock-response-plugin.yml @@ -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 \ No newline at end of file diff --git a/venom-tests/samples/httpbin_mock.yaml b/venom-tests/samples/httpbin_mock.yaml new file mode 100644 index 000000000..de5bae81f --- /dev/null +++ b/venom-tests/samples/httpbin_mock.yaml @@ -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 \ No newline at end of file