Skip to content

Strengthen async adaptation-failure transport tests to assert synchronous exceptional completion #121

@OmarAlJarrah

Description

@OmarAlJarrah

Follow-up from #119.

The two tests added in #119OkHttpTransportTest.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    sdk-coresdk-core toolkittech-debtsimplification / cleanup

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions