forked from hungdv136/rio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stubs.yaml
124 lines (121 loc) · 3.49 KB
/
stubs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
stubs:
- active: true
namespace: ""
request:
body:
- content_type: application/json
key_path: $.book.type
operator:
name: equal_to
value: How to write test in Golang
cookie:
- field_name: SESSION_ID
operator:
name: equal_to
value: 27a6c092-3bdc-4f46-b1fb-1c7c5eea39e0
header:
- field_name: X-REQUEST-ID
operator:
name: equal_to
value: f5dcaabc-caac-4c5e-9e06-6b1e935b756d
method: GET
url:
- name: contains
value: animal/create
response:
template:
script_schema_type: yaml
script: >
status_code: 200
cookies:
{{ range $cookie := .Request.Cookies }}
- name: {{ $cookie.Name }}
value: {{ $cookie.Value }}
{{end}}
headers:
X-REQUEST-ID: {{ .Request.Header.Get "X-REQUEST-ID"}}
body: >
{
"encrypted_value": "{{ encryptAES "e09b3cc3b4943e2558d1882c9ef999eb" .JSONBody.naked_value}}"
}
settings:
deactivate_when_matched: false
delay_duration: 0s
weight: 0
- active: true
request:
method: GET
url:
- name: contains
value: animal/create_html
response:
header:
Content-Type: text/html
body: >
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Bank</title>
</head>
<body>
<h1>TPBank OTP</h1>
<p>Input your OTP</p>
<label>
<input type="text">
</label>
<button type="button" onclick="handleSubmit()">Submit</button>
<script>
function handleSubmit() {
const params = new Proxy(new URLSearchParams(window.location.search), {
get: (searchParams, prop) => searchParams.get(prop),
});
window.location.href =
`http://localhost:8080/public/otp/callback?payment_intent_id=${params.payment_intent_id}&merchant_id=${params.merchant_id}&psp_code=${params.psp_code}&signature=${params.signature}`;
}
</script>
</body>
</html>
- active: true
request:
method: GET
url:
- name: contains
value: animal/create_xml
response:
header:
Content-Type: text/xml
body: >
<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
</catalog>
- active: true
request:
method: GET
url:
- name: contains
value: animal/create_json
response:
header:
Content-Type: application/json
body: >
{
"key": "This is value"
}
error:
message: This is error
details:
- type: common.v1.CommonError
value:
key: This is value of detail