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
{{ message }}
This repository has been archived by the owner on Sep 12, 2022. It is now read-only.
Hi, is there any assurance that the enqueue order is the processing order?
I mean the code below works "some times"...
@Test
funshouldFailDueRequestOrder() {
val url = server.url("/").toString()
val request =Request.Builder()
.url(url +"get")
.build()
val client =OkHttpClient
.Builder()
.build()
server.addResponse(MockResponse()
.setResponseCode(HttpStatus.HTTP_UNAVAILABLE))
.ifRequestMatches()
.pathIs("/get")
server.addFixture(200, "test.json")
.ifRequestMatches()
.pathIs("/get")
assertFalse(client.newCall(request).execute().isSuccessful)
assertTrue(client.newCall(request).execute().isSuccessful)
}
To make it work all times we need to move the addFixture to after the first assert.
@Test
funshouldFailDueRequestOrder() {
val url = server.url("/").toString()
val request =Request.Builder()
.url(url +"get")
.build()
val client =OkHttpClient
.Builder()
.build()
server.addResponse(MockResponse()
.setResponseCode(HttpStatus.HTTP_UNAVAILABLE))
.ifRequestMatches()
.pathIs("/get")
assertFalse(client.newCall(request).execute().isSuccessful)
server.addFixture(200, "test.json")
.ifRequestMatches()
.pathIs("/get")
assertTrue(client.newCall(request).execute().isSuccessful)
}
is this the expected behaviour? It would be helpful to be able to declare the expected requests in the beginning of each test so we split the setup from the test execution.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, is there any assurance that the enqueue order is the processing order?
I mean the code below works "some times"...
To make it work all times we need to move the addFixture to after the first assert.
is this the expected behaviour? It would be helpful to be able to declare the expected requests in the beginning of each test so we split the setup from the test execution.
The text was updated successfully, but these errors were encountered: