conjure-java-runtime
conjure-java-runtime copied to clipboard
Retrofit clients should treat HTTP 204 as empty
Our jax-rs clients already interpret a http 204 as Optional.empty, but the retrofit clients return it as null!
@Test
public void retrofit2_client_can_retrieve_an_optional_empty() throws Exception {
assertThat(client.optionalEmpty(AuthHeader.valueOf("authHeader")).execute().body())
.isEqualTo(Optional.empty());
}
org.junit.ComparisonFailure:
Expected :Optional.empty
Actual :null
<Click to see difference>
This issue has been automatically marked as stale because it has not been touched in the last 60 days. Please comment if you'd like to keep it open, otherwise it'll be closed in 7 days time.
Would like to keep this open until this runs the standardized test-cases.yml from conjure-verification
This issue has been automatically marked as stale because it has not been touched in the last 60 days. Please comment if you'd like to keep it open, otherwise it'll be closed in 7 days time.
Looking into solving this once and for all... we are already running the conjure-verification test harness (added in https://github.com/palantir/conjure-java-runtime/pull/853), but only for JaxRsClients.
Next steps are:
- rework VerificationClients so that it can create retrofit2 clients
- modify
AutoDeserializeTestandSingleParamServicesTestsomehow so that they can use both jaxrs and retrofit clients - ensure there can be a separate ignored-test-cases.yml for retrofit and jaxrs clients
Seen in <redacted internal jira>/PDS-88221.
This issue has been automatically marked as stale because it has not been touched in the last 60 days. Please comment if you'd like to keep it open, otherwise it'll be closed in 7 days time.