mahbaleshwar hegde
05/24/2023, 8:01 AM{
"mappings": [
{
"priority": 1,
"request": {
"method": "GET",
"url": "/posts"
},
"response": {
"status": 200,
"bodyFileName": "posts-default.json"
}
},
{
"priority": 2,
"request": {
"url": "/posts"
},
"response": {
"status": 200,
"bodyFileName": "posts-empty.json"
}
},
{
"priority": 3,
"request": {
"url": "/posts"
},
"response": {
"status": 500,
"bodyFileName": "posts-error.json"
}
}
]
}
Can anyone help me how to achieve one url which has multiple response?Kapish Malik
05/24/2023, 9:01 AMmahbaleshwar hegde
05/24/2023, 9:04 AMKapish Malik
05/24/2023, 9:20 AM"headers": {
"response-type": {
"equalTo": "error"
}
}
mahbaleshwar hegde
05/24/2023, 10:15 AMresponse-type
header.
I am using https://github.com/mobileforming/WiremockClient.git.
My Stubbing goes like this:
let stub = StubMapping.stubFor(requestMethod: .GET,
urlMatchCondition: .urlPathEqualTo,
url: endPoint)
.withHeader("response-type", matchCondition: .equalTo, value: "success")
.willReturn(ResponseDefinition())
I have tried to serve response from local file aprt from this approach. It doesn't work. Can you throw some insights how wiremock pick the response apart from most recent stub?Kapish Malik
05/24/2023, 10:25 AMmahbaleshwar hegde
05/24/2023, 12:54 PMapiClient.register {
RESTAPIClient(url: URL(string: "<http://localhost:8080/>")!)
}
func test_02ShouldDisplayBlogList() throws {
app.launch()
blogPostListStub.successResponse()
let cell = app.tables["blogPostTableView"].cells.firstMatch
XCTAssertTrue(cell.waitForExistence(timeout: 10.0))
}
Kapish Malik
05/24/2023, 1:22 PMmahbaleshwar hegde
05/29/2023, 2:39 PMOleg Nenashev
05/31/2023, 6:50 AM