Follow-up from #119.
The two tests added in #119 — OkHttpTransportTest.executeAsyncDeliversAdaptationFailureThroughFuture and JdkHttpTransportTest.executeAsyncDeliversAdaptationFailureThroughFuture — verify that an adaptation failure surfaces as the future's cause (an ExecutionException wrapping IllegalArgumentException). They already guard against a regression to a synchronous throw, because executeAsync(...) is called outside the assertFailsWith block.
Two cheap additions would tighten the guarantee:
- Assert
future.isCompletedExceptionally() is already true on return, making "completion is synchronous, not merely eventual" explicit rather than implied by get(5, SECONDS) not timing out.
- Assert the exception message (or a substring) so an unrelated
IllegalArgumentException from elsewhere cannot satisfy the test.
Scope
Test-only; no production change. Apply symmetrically to both transports.
Follow-up from #119.
The two tests added in #119 —
OkHttpTransportTest.executeAsyncDeliversAdaptationFailureThroughFutureandJdkHttpTransportTest.executeAsyncDeliversAdaptationFailureThroughFuture— verify that an adaptation failure surfaces as the future's cause (anExecutionExceptionwrappingIllegalArgumentException). They already guard against a regression to a synchronous throw, becauseexecuteAsync(...)is called outside theassertFailsWithblock.Two cheap additions would tighten the guarantee:
future.isCompletedExceptionally()is already true on return, making "completion is synchronous, not merely eventual" explicit rather than implied byget(5, SECONDS)not timing out.IllegalArgumentExceptionfrom elsewhere cannot satisfy the test.Scope
Test-only; no production change. Apply symmetrically to both transports.