Skip to content
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

Merged
merged 2 commits into from
May 22, 2023
Merged

Increasing Test Coverages #866

merged 2 commits into from
May 22, 2023

Conversation

iNoles
Copy link
Collaborator

@iNoles iNoles commented May 13, 2023

I have been trying to increase test coverages in specific modules while doing some cleanup.

The most challenging part is Jackson and commonMain.

@iNoles iNoles requested a review from kittinunf May 13, 2023 03:25
@iNoles iNoles self-assigned this May 13, 2023
public inline fun <reified T : Any> HttpResponse.toJackson(
mapper: ObjectMapper = jacksonObjectMapper()
): Result<T?, Throwable> =
runCatching {
Copy link
Owner

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)
Copy link
Owner

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)
}

Copy link
Collaborator Author

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.

Copy link
Owner

@kittinunf kittinunf left a 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

@kittinunf kittinunf merged commit 555db5e into main May 22, 2023
@delete-merged-branch delete-merged-branch bot deleted the increase_test branch May 22, 2023 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants