-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: adds bt http client #74
Conversation
8953130
to
5964f1b
Compare
5964f1b
to
2787290
Compare
2787290
to
110a07f
Compare
send(url, HttpMethod.DELETE, null, headers) | ||
} | ||
|
||
private fun requestBuilder( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rename this to buildRequest since it is building it already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed ✅
</LinearLayout> | ||
|
||
|
||
<TextView |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the difference between payment_method and result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed payment_method
val foo = "bar" | ||
} | ||
|
||
server.enqueue(MockResponse().setBody("Everything is broken").setResponseCode(500)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it really returns 500? it feels like we should return 400
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just MockedWebServer; it could return anything you want and in this test we're just making sure we throw when using unsupported content-type
s in the request; we don't have control over the responses from the 3rd-parties anyways
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but if they provide a content type that the client doesn't support does it return 500?
val request = server.takeRequest() | ||
assertEquals("POST", request.method) | ||
assertEquals(endpoint, request.path) | ||
assertEquals(expectedRequestBody, request.body.readUtf8()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you assert on the response of all of these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I can. Do you see any value tho? Or is there anything in particular you'd like to see? Because it's pretty much the same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in which one are you asserting the response?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to make sure nothing is updating the response and we get what we expect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'll leave it up to you
// RequestBody appends the charset by default | ||
assertEquals(expectedRequestBody.contentType(), "$contentType; charset=utf-8".toMediaType()) | ||
assertEquals(expectedRequestBody.contentLength(), requestBody?.contentLength()) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you remove these extra lines
import java.io.IOException | ||
|
||
class DualWriteUtilsTests { | ||
private val faker = Faker() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you using this anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not; removed.
Description
Testing required outside of automated testing?
Screenshots (if appropriate):
Rollback / Rollforward Procedure
Reviewer Checklist