|
1 | 1 | Feature: demo symfony application |
2 | 2 |
|
3 | | - Scenario: Default method resolver with JSON-RPC method tags |
| 3 | + @symfony-extension @symfony-jsonrpc-method-tag |
| 4 | + Scenario: Use Extension with default method resolver with JSON-RPC method tags |
4 | 5 | # Ensure the two methods with tag have been loaded |
5 | 6 | When I send following "POST" input on "/my-json-rpc-endpoint" demoApp kernel endpoint: |
6 | 7 | """ |
7 | | - {"jsonrpc": "2.0", "method": "methodA", "id": 1} |
| 8 | + {"jsonrpc": "2.0", "method": "defaultMethodA", "id": 1} |
8 | 9 | """ |
9 | 10 | Then I should have a "200" response from demoApp with following content: |
10 | 11 | """ |
11 | 12 | {"jsonrpc":"2.0", "result":"MethodA", "id":1} |
12 | 13 | """ |
13 | 14 | When I send following "POST" input on "/my-json-rpc-endpoint" demoApp kernel endpoint: |
14 | 15 | """ |
15 | | - {"jsonrpc": "2.0", "method": "MethodB", "id": 2} |
| 16 | + {"jsonrpc": "2.0", "method": "defaultMethodAAlias", "id": 2} |
16 | 17 | """ |
17 | 18 | Then I should have a "200" response from demoApp with following content: |
18 | 19 | """ |
19 | | - {"jsonrpc":"2.0", "result":"MethodB", "id":2} |
| 20 | + {"jsonrpc":"2.0", "result":"MethodA", "id":2} |
| 21 | + """ |
| 22 | + When I send following "POST" input on "/my-json-rpc-endpoint" demoApp kernel endpoint: |
| 23 | + """ |
| 24 | + {"jsonrpc": "2.0", "method": "defaultMethodB", "id": 3} |
| 25 | + """ |
| 26 | + Then I should have a "200" response from demoApp with following content: |
| 27 | + """ |
| 28 | + {"jsonrpc":"2.0", "result":"MethodB", "id":3} |
| 29 | + """ |
| 30 | + |
| 31 | + @symfony-extension |
| 32 | + Scenario: Use Extension with default method resolver with JSON-RPC methods container injection |
| 33 | + # Ensure the two injected methods have been injected |
| 34 | + When I send following "POST" input on "/my-json-rpc-endpoint" demoApp kernel endpoint: |
| 35 | + """ |
| 36 | + {"jsonrpc": "2.0", "method": "defaultGetDummy", "id": 1} |
| 37 | + """ |
| 38 | + Then I should have a "200" response from demoApp with following content: |
| 39 | + """ |
| 40 | + {"jsonrpc":"2.0", "result":"MethodC", "id":1} |
| 41 | + """ |
| 42 | + When I send following "POST" input on "/my-json-rpc-endpoint" demoApp kernel endpoint: |
| 43 | + """ |
| 44 | + {"jsonrpc": "2.0", "method": "defaultGetAnotherDummy", "id": 2} |
| 45 | + """ |
| 46 | + Then I should have a "200" response from demoApp with following content: |
| 47 | + """ |
| 48 | + {"jsonrpc":"2.0", "result":"MethodD", "id":2} |
20 | 49 | """ |
21 | 50 |
|
22 | | - Scenario: Default method resolver with JSON-RPC methods container injection |
23 | | - # Ensure the two injected methods have been loaded |
| 51 | + @symfony-extension @symfony-method-resolver-tag |
| 52 | + Scenario: Use Extension with custom method resolver |
| 53 | + Given I use my DemoApp custom method resolver |
| 54 | + # Ensure all methods have been loaded |
| 55 | + When I send following "POST" input on "/my-json-rpc-endpoint" demoApp kernel endpoint: |
| 56 | + """ |
| 57 | + {"jsonrpc": "2.0", "method": "customMethodA", "id": 1} |
| 58 | + """ |
| 59 | + Then I should have a "200" response from demoApp with following content: |
| 60 | + """ |
| 61 | + {"jsonrpc":"2.0", "result":"MethodA", "id":1} |
| 62 | + """ |
| 63 | + When I send following "POST" input on "/my-json-rpc-endpoint" demoApp kernel endpoint: |
| 64 | + """ |
| 65 | + {"jsonrpc": "2.0", "method": "customMethodB", "id": 2} |
| 66 | + """ |
| 67 | + Then I should have a "200" response from demoApp with following content: |
| 68 | + """ |
| 69 | + {"jsonrpc":"2.0", "result":"MethodB", "id":2} |
| 70 | + """ |
24 | 71 | When I send following "POST" input on "/my-json-rpc-endpoint" demoApp kernel endpoint: |
25 | 72 | """ |
26 | | - {"jsonrpc": "2.0", "method": "getDummy", "id": 3} |
| 73 | + {"jsonrpc": "2.0", "method": "customMethodC", "id": 3} |
27 | 74 | """ |
28 | 75 | Then I should have a "200" response from demoApp with following content: |
29 | 76 | """ |
30 | 77 | {"jsonrpc":"2.0", "result":"MethodC", "id":3} |
31 | 78 | """ |
32 | 79 | When I send following "POST" input on "/my-json-rpc-endpoint" demoApp kernel endpoint: |
33 | 80 | """ |
34 | | - {"jsonrpc": "2.0", "method": "getAnotherDummy", "id": 4} |
| 81 | + {"jsonrpc": "2.0", "method": "customMethodD", "id": 4} |
35 | 82 | """ |
36 | 83 | Then I should have a "200" response from demoApp with following content: |
37 | 84 | """ |
38 | 85 | {"jsonrpc":"2.0", "result":"MethodD", "id":4} |
39 | 86 | """ |
40 | 87 |
|
41 | | - Scenario: custom method resolver |
42 | | - Given I use my DemoApp custom method resolver |
| 88 | + @symfony-bundle @symfony-jsonrpc-method-tag |
| 89 | + Scenario: Use Bundle with default method resolver with JSON-RPC method tags |
| 90 | + Given DemoApp will use JsonRpcHttpServerBundle |
| 91 | + # Ensure the two methods with tag have been loaded |
| 92 | + When I send following "POST" input on "/my-json-rpc-endpoint" demoApp kernel endpoint: |
| 93 | + """ |
| 94 | + {"jsonrpc": "2.0", "method": "bundledMethodA", "id": 1} |
| 95 | + """ |
| 96 | + Then I should have a "200" response from demoApp with following content: |
| 97 | + """ |
| 98 | + {"jsonrpc":"2.0", "result":"MethodA", "id":1} |
| 99 | + """ |
| 100 | + When I send following "POST" input on "/my-json-rpc-endpoint" demoApp kernel endpoint: |
| 101 | + """ |
| 102 | + {"jsonrpc": "2.0", "method": "bundledMethodAAlias", "id": 2} |
| 103 | + """ |
| 104 | + Then I should have a "200" response from demoApp with following content: |
| 105 | + """ |
| 106 | + {"jsonrpc":"2.0", "result":"MethodA", "id":2} |
| 107 | + """ |
| 108 | + When I send following "POST" input on "/my-json-rpc-endpoint" demoApp kernel endpoint: |
| 109 | + """ |
| 110 | + {"jsonrpc": "2.0", "method": "bundledMethodB", "id": 3} |
| 111 | + """ |
| 112 | + Then I should have a "200" response from demoApp with following content: |
| 113 | + """ |
| 114 | + {"jsonrpc":"2.0", "result":"MethodB", "id":3} |
| 115 | + """ |
| 116 | + |
| 117 | + @symfony-bundle |
| 118 | + Scenario: Use Bundle with default method resolver with JSON-RPC methods container injection |
| 119 | + Given DemoApp will use JsonRpcHttpServerBundle |
| 120 | + # Ensure the two injected methods have been injected |
| 121 | + When I send following "POST" input on "/my-json-rpc-endpoint" demoApp kernel endpoint: |
| 122 | + """ |
| 123 | + {"jsonrpc": "2.0", "method": "bundledGetDummy", "id": 1} |
| 124 | + """ |
| 125 | + Then I should have a "200" response from demoApp with following content: |
| 126 | + """ |
| 127 | + {"jsonrpc":"2.0", "result":"MethodC", "id":1} |
| 128 | + """ |
| 129 | + When I send following "POST" input on "/my-json-rpc-endpoint" demoApp kernel endpoint: |
| 130 | + """ |
| 131 | + {"jsonrpc": "2.0", "method": "bundledGetAnotherDummy", "id": 2} |
| 132 | + """ |
| 133 | + Then I should have a "200" response from demoApp with following content: |
| 134 | + """ |
| 135 | + {"jsonrpc":"2.0", "result":"MethodD", "id":2} |
| 136 | + """ |
| 137 | + |
| 138 | + @symfony-bundle @symfony-method-resolver-tag |
| 139 | + Scenario: Bundle with custom method resolver tag |
| 140 | + Given DemoApp will use JsonRpcHttpServerBundle |
| 141 | + And I use my DemoApp custom method resolver |
43 | 142 | # Ensure all methods have been loaded |
44 | 143 | When I send following "POST" input on "/my-json-rpc-endpoint" demoApp kernel endpoint: |
45 | 144 | """ |
46 | | - {"jsonrpc": "2.0", "method": "custom_methodA", "id": 1} |
| 145 | + {"jsonrpc": "2.0", "method": "customBundledMethodA", "id": 1} |
47 | 146 | """ |
48 | 147 | Then I should have a "200" response from demoApp with following content: |
49 | 148 | """ |
50 | 149 | {"jsonrpc":"2.0", "result":"MethodA", "id":1} |
51 | 150 | """ |
52 | 151 | When I send following "POST" input on "/my-json-rpc-endpoint" demoApp kernel endpoint: |
53 | 152 | """ |
54 | | - {"jsonrpc": "2.0", "method": "custom_methodB", "id": 2} |
| 153 | + {"jsonrpc": "2.0", "method": "customBundledMethodB", "id": 2} |
55 | 154 | """ |
56 | 155 | Then I should have a "200" response from demoApp with following content: |
57 | 156 | """ |
58 | 157 | {"jsonrpc":"2.0", "result":"MethodB", "id":2} |
59 | 158 | """ |
60 | 159 | When I send following "POST" input on "/my-json-rpc-endpoint" demoApp kernel endpoint: |
61 | 160 | """ |
62 | | - {"jsonrpc": "2.0", "method": "custom_methodC", "id": 3} |
| 161 | + {"jsonrpc": "2.0", "method": "customBundledMethodC", "id": 3} |
63 | 162 | """ |
64 | 163 | Then I should have a "200" response from demoApp with following content: |
65 | 164 | """ |
66 | 165 | {"jsonrpc":"2.0", "result":"MethodC", "id":3} |
67 | 166 | """ |
68 | 167 | When I send following "POST" input on "/my-json-rpc-endpoint" demoApp kernel endpoint: |
69 | 168 | """ |
70 | | - {"jsonrpc": "2.0", "method": "custom_methodD", "id": 4} |
| 169 | + {"jsonrpc": "2.0", "method": "customBundledMethodD", "id": 4} |
71 | 170 | """ |
72 | 171 | Then I should have a "200" response from demoApp with following content: |
73 | 172 | """ |
|
0 commit comments