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

SttpMockServerClient drops null values #2175

Merged
merged 7 commits into from
Jun 7, 2022

Conversation

mkrzemien
Copy link
Contributor

Closes #2128

@mkrzemien mkrzemien self-assigned this Jun 2, 2022
@mkrzemien mkrzemien marked this pull request as ready for review June 2, 2022 14:19
@mkrzemien mkrzemien requested a review from adamw June 6, 2022 07:45
.thenError(sampleErrorOut, statusCode = StatusCode.BadRequest)

expectations should have size 1
println(expectations.head.httpRequest.path)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

println - probably to remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true

}

it should "match json body with drop null" in {
import TapirJsonCirceWithDropNull._
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this ever used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to make it explicit for these two cases that they are using different configurations related to this drop option.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but are they? are you using the jsonBody method defined by these objects anywhere?

@@ -537,6 +544,252 @@ class MockServerSpec extends AnyFlatSpec with Matchers {
)
}

it should "match json body without drop null" in {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these tests are enormous. Is there a way to somehow deduplicate them, so that it would be visible what's the difference in the null handling, and where the nulls are in the first palce (or not)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'm on it

@adamw
Copy link
Member

adamw commented Jun 6, 2022

Can you rebase? The examples are now moved to dedicated directories

@mkrzemien mkrzemien force-pushed the 2128-sttpmockserverclient-drops-null-values branch 2 times, most recently from eadaac4 to 71b154f Compare June 7, 2022 08:57
@mkrzemien mkrzemien requested a review from adamw June 7, 2022 09:34
@mkrzemien mkrzemien force-pushed the 2128-sttpmockserverclient-drops-null-values branch from 84c5bbc to baae091 Compare June 7, 2022 11:51
@mkrzemien mkrzemien requested a review from adamw June 7, 2022 15:37
@adamw adamw merged commit 81a8fda into master Jun 7, 2022
@mergify mergify bot deleted the 2128-sttpmockserverclient-drops-null-values branch June 7, 2022 17:26
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.

SttpMockServerClient drops null values
2 participants