You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// match all URLs with path ending with "suffix" and have "param" with "value" as query parameter e.g. http://example.test/prefix/user/suffix?param=value
// match all URLs with path ending with "suffix" and have multiple parameter name/value pairs e.g.http://example.test/prefix/user/suffix?param=value¶m2=value2
130
+
dispatcher.putResponse(
131
+
factory.withPathSuffixAndQueryParameters("suffix", mapOf("param" to "value", "param2" to "value2")),
132
+
"response_with_multiple_query_parameters"
133
+
)
129
134
mockWebServer.setDispatcher(dispatcher)
130
135
}
131
136
```
@@ -140,6 +145,15 @@ fun pathQueryCondition() {
140
145
141
146
}
142
147
```
148
+
Also supports a map of multiple query parameters:
149
+
150
+
```kotlin
151
+
fun pathQueryConditions() {
152
+
val dispatcher = FixtureDispatcher()
153
+
dispatcher.putResponse(PathQueryCondition("/prefix/suffix", mapOf("param" to "value", "param2" to "value2")), "response_with_query_parameters_and_values")
154
+
mockWebServer.setDispatcher(dispatcher)
155
+
}
156
+
```
143
157
144
158
`HttpUrlCondition`- when you want to match by some part of URL other than path or single query
0 commit comments