-
Notifications
You must be signed in to change notification settings - Fork 3
/
http-proxy.yml
49 lines (49 loc) · 1.39 KB
/
http-proxy.yml
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
actuators:
- name: actuator proxy
type: http
url: http://localhost:23085/proxy/enqueuer/123456?query=proxied
method: put
payload: original
onMessageReceived:
assertions:
- expect: statusCode
toBeEqualTo: 400
- expect: body
toBeEqualTo: "'original -> proxy -> real -> proxied again'"
sensors:
- name: proxy sensor
type: http-proxy
endpoint: /proxy/enqueuer/:id
port: 23085
method: put
redirect:
url: http://localhost:23086/real/enqueuer/999?query=proxied
method: POST
onOriginalMessageReceived:
script: this.redirect.payload = body + " -> proxy";
assertions:
- expect: body
toBeEqualTo: "'original'"
onMessageReceived:
script: this.response.payload = body + "' -> proxied again'"; this.response.status = 2 * statusCode;
assertions:
- expect: body
toBeEqualTo: "'original -> proxy -> real'"
- expect: statusCode
toBeEqualTo: 200
- name: real
type: http
endpoint: /real/enqueuer/:id
port: 23086
method: POST
response:
status: 200
onMessageReceived:
script: this.response.payload = body + ' -> real';
assertions:
- expect: body
toBeEqualTo: "'original -> proxy'"
- expect: params.id
toBeEqualTo: 999
- expect: query.query
toBeEqualTo: "'proxied'"