@@ -102,15 +102,15 @@ public void shouldBuildAnyMethodRequestWithPathMatcher() {
102
102
}
103
103
104
104
@ Test
105
- public void shouldBuildExactQueryMatcher () {
105
+ public void shouldBuildArrayQueryMatcher () {
106
106
// When
107
107
final Set <RequestResponsePair > pairs = service ("www.base-url.com" ).get ("/" ).queryParam ("foo" , "bar" )
108
108
.willReturn (response ()).getRequestResponsePairs ();
109
109
110
110
// Then
111
111
assertThat (pairs ).hasSize (1 );
112
112
Map <String , List <RequestFieldMatcher >> query = Iterables .getLast (pairs ).getRequest ().getQuery ();
113
- assertThat (query ).containsExactly (MapEntry .entry ("foo" , singletonList (newExactMatcher ( "bar" ))));
113
+ assertThat (query ).containsExactly (MapEntry .entry ("foo" , singletonList (newArrayMatcher ( singletonList ( "bar" ) ))));
114
114
}
115
115
116
116
// TODO Not supported
@@ -166,13 +166,13 @@ public void shouldBuildExactQueryWithMultipleKeyValuePairs() {
166
166
assertThat (pairs ).hasSize (1 );
167
167
Map <String , List <RequestFieldMatcher >> query = Iterables .getLast (pairs ).getRequest ().getQuery ();
168
168
assertThat (query ).containsOnly (
169
- MapEntry .entry ("page" , singletonList (newExactMatcher ( "1" ))),
170
- MapEntry .entry ("size" , singletonList (newExactMatcher ( "10" )))
169
+ MapEntry .entry ("page" , singletonList (newArrayMatcher ( singletonList ( "1" ) ))),
170
+ MapEntry .entry ("size" , singletonList (newArrayMatcher ( singletonList ( "10" ) )))
171
171
);
172
172
}
173
173
174
174
@ Test
175
- public void shouldBuildExactQueryForKeyWithMultipleValues () {
175
+ public void shouldBuildQueryArrayMatcherForKeyWithMultipleValues () {
176
176
// When
177
177
final Set <RequestResponsePair > pairs = service ("www.base-url.com" ).get ("/" )
178
178
.queryParam ("category" , "food" , "drink" )
@@ -182,7 +182,7 @@ public void shouldBuildExactQueryForKeyWithMultipleValues() {
182
182
assertThat (pairs ).hasSize (1 );
183
183
Map <String , List <RequestFieldMatcher >> query = Iterables .getLast (pairs ).getRequest ().getQuery ();
184
184
assertThat (query ).containsExactly (
185
- MapEntry .entry ("category" , singletonList (newExactMatcher ( "food; drink" )))
185
+ MapEntry .entry ("category" , singletonList (newArrayMatcher ( Arrays . asList ( "food" , " drink") )))
186
186
);
187
187
}
188
188
@@ -204,7 +204,7 @@ public void shouldBuildQueryWithMultipleFuzzyMatchers() {
204
204
}
205
205
206
206
@ Test
207
- public void shouldBuildQueryWithBothExactAndFuzzyMatchers () {
207
+ public void shouldBuildQueryWithBothArrayAndFuzzyMatchers () {
208
208
// When
209
209
final Set <RequestResponsePair > pairs = service ("www.base-url.com" ).get ("/" )
210
210
.queryParam ("page" , any ())
@@ -216,7 +216,7 @@ public void shouldBuildQueryWithBothExactAndFuzzyMatchers() {
216
216
Map <String , List <RequestFieldMatcher >> query = Iterables .getLast (pairs ).getRequest ().getQuery ();
217
217
assertThat (query ).containsOnly (
218
218
MapEntry .entry ("page" , singletonList (newRegexMatcher (".*" ))),
219
- MapEntry .entry ("category" , singletonList (newExactMatcher ( "food" )))
219
+ MapEntry .entry ("category" , singletonList (newArrayMatcher ( singletonList ( "food" ) )))
220
220
);
221
221
}
222
222
@@ -273,7 +273,7 @@ public void shouldNotEncodeSpacesInQueryParams() {
273
273
assertThat (pairs ).hasSize (1 );
274
274
Map <String , List <RequestFieldMatcher >> query = Iterables .getLast (pairs ).getRequest ().getQuery ();
275
275
assertThat (query ).containsExactly (
276
- MapEntry .entry ("destination" , singletonList (newExactMatcher ( "New York" )))
276
+ MapEntry .entry ("destination" , singletonList (newArrayMatcher ( singletonList ( "New York" ) )))
277
277
);
278
278
}
279
279
0 commit comments