-
Notifications
You must be signed in to change notification settings - Fork 432
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
Increasing Test Coverages #866
Conversation
public inline fun <reified T : Any> HttpResponse.toJackson( | ||
mapper: ObjectMapper = jacksonObjectMapper() | ||
): Result<T?, Throwable> = | ||
runCatching { |
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.
Cool 👍
@@ -45,19 +51,14 @@ class FuelJacksonTest { | |||
} | |||
|
|||
val response = Fuel.get(mockWebServer.url("user-agent").toString()) | |||
val jackson = response.toJackson<HttpBinUserAgentModel>(createCustomMapper()) | |||
val jackson = response.toJackson<HttpBinUserAgentModel>(createCustomMapper) |
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.
[q] Just wondering whether we could provide a nice DSL for client to configure the mapper?
fun toJackson<T>(configure: ObjectMapper.() -> Unit) {
val mapper = ObjectMapper()
mapper.apply(configure)
}
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.
you could have to write a PR about it.
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.
Not a blocker concern
I have been trying to increase test coverages in specific modules while doing some cleanup.
The most challenging part is Jackson and commonMain.