@@ -96,6 +96,47 @@ public void getRequestWithQueryString() throws IOException {
96
96
.request ("http://localhost/foo?param=value" ).build ());
97
97
}
98
98
99
+ @ Test
100
+ public void getRequestWithTotallyOverlappingQueryStringAndParameters ()
101
+ throws IOException {
102
+ this .snippet
103
+ .expectHttpieRequest (
104
+ "request-with-totally-overlapping-query-string-and-parameters" )
105
+ .withContents (codeBlock ("bash" )
106
+ .content ("$ http GET 'http://localhost/foo?param=value'" ));
107
+ new HttpieRequestSnippet ().document (operationBuilder (
108
+ "request-with-totally-overlapping-query-string-and-parameters" )
109
+ .request ("http://localhost/foo?param=value" )
110
+ .param ("param" , "value" ).build ());
111
+ }
112
+
113
+ @ Test
114
+ public void getRequestWithPartiallyOverlappingQueryStringAndParameters ()
115
+ throws IOException {
116
+ this .snippet
117
+ .expectHttpieRequest (
118
+ "request-with-partially-overlapping-query-string-and-parameters" )
119
+ .withContents (codeBlock ("bash" )
120
+ .content ("$ http GET 'http://localhost/foo?a=alpha&b=bravo'" ));
121
+ new HttpieRequestSnippet ().document (operationBuilder (
122
+ "request-with-partially-overlapping-query-string-and-parameters" )
123
+ .request ("http://localhost/foo?a=alpha" ).param ("a" , "alpha" )
124
+ .param ("b" , "bravo" ).build ());
125
+ }
126
+
127
+ @ Test
128
+ public void getRequestWithDisjointQueryStringAndParameters () throws IOException {
129
+ this .snippet
130
+ .expectHttpieRequest (
131
+ "request-with-partially-overlapping-query-string-and-parameters" )
132
+ .withContents (codeBlock ("bash" )
133
+ .content ("$ http GET 'http://localhost/foo?a=alpha&b=bravo'" ));
134
+ new HttpieRequestSnippet ().document (operationBuilder (
135
+ "request-with-partially-overlapping-query-string-and-parameters" )
136
+ .request ("http://localhost/foo?a=alpha" ).param ("b" , "bravo" )
137
+ .build ());
138
+ }
139
+
99
140
@ Test
100
141
public void getRequestWithQueryStringWithNoValue () throws IOException {
101
142
this .snippet .expectHttpieRequest ("request-with-query-string-with-no-value" )
@@ -173,25 +214,42 @@ public void postRequestWithUrlEncodedParameter() throws IOException {
173
214
}
174
215
175
216
@ Test
176
- public void postRequestWithQueryStringAndParameter () throws IOException {
177
- this .snippet .expectHttpieRequest ("post-request-with-query-string-and-parameter" )
217
+ public void postRequestWithDisjointQueryStringAndParameter () throws IOException {
218
+ this .snippet
219
+ .expectHttpieRequest (
220
+ "post-request-with-disjoint-query-string-and-parameter" )
178
221
.withContents (codeBlock ("bash" ).content (
179
222
"$ http --form POST 'http://localhost/foo?a=alpha' 'b=bravo'" ));
180
- new HttpieRequestSnippet ()
181
- . document ( operationBuilder ("post-request-with-query-string-and-parameter" )
223
+ new HttpieRequestSnippet (). document (
224
+ operationBuilder ("post-request-with-disjoint -query-string-and-parameter" )
182
225
.request ("http://localhost/foo?a=alpha" ).method ("POST" )
183
226
.param ("b" , "bravo" ).build ());
184
227
}
185
228
186
229
@ Test
187
- public void postRequestWithOverlappingQueryStringAndParameters () throws IOException {
230
+ public void postRequestWithTotallyOverlappingQueryStringAndParameters ()
231
+ throws IOException {
232
+ this .snippet
233
+ .expectHttpieRequest (
234
+ "post-request-with-totally-overlapping-query-string-and-parameters" )
235
+ .withContents (codeBlock ("bash" )
236
+ .content ("$ http POST 'http://localhost/foo?a=alpha&b=bravo'" ));
237
+ new HttpieRequestSnippet ().document (operationBuilder (
238
+ "post-request-with-totally-overlapping-query-string-and-parameters" )
239
+ .request ("http://localhost/foo?a=alpha&b=bravo" ).method ("POST" )
240
+ .param ("a" , "alpha" ).param ("b" , "bravo" ).build ());
241
+ }
242
+
243
+ @ Test
244
+ public void postRequestWithPartiallyOverlappingQueryStringAndParameters ()
245
+ throws IOException {
188
246
this .snippet
189
247
.expectHttpieRequest (
190
- "post-request-with-overlapping-query-string-and-parameters" )
248
+ "post-request-with-partially- overlapping-query-string-and-parameters" )
191
249
.withContents (codeBlock ("bash" ).content (
192
250
"$ http --form POST 'http://localhost/foo?a=alpha' 'b=bravo'" ));
193
251
new HttpieRequestSnippet ().document (operationBuilder (
194
- "post-request-with-overlapping-query-string-and-parameters" )
252
+ "post-request-with-partially- overlapping-query-string-and-parameters" )
195
253
.request ("http://localhost/foo?a=alpha" ).method ("POST" )
196
254
.param ("a" , "alpha" ).param ("b" , "bravo" ).build ());
197
255
}
0 commit comments