Skip to content

test: cover exception passthrough in Scala RouteTest - #2100

Open
He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:test/route-test-exception-passthrough
Open

He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:test/route-test-exception-passthrough

Conversation

@He-Pin

@He-Pin He-Pin commented Dec 6, 2026

Copy link
Copy Markdown
Member

Motivation

The unsealed RouteTest adapter is meant to preserve failures, but its synchronous and asynchronous paths did not have direct assertions.

Modification

Call the real RouteTest helper and assert that synchronous throw and asynchronous failure expose the original exception instance.

Result

On Scala 2.13.18 and JDK 21 the two new cases passed against the actual tester and routing code. Substituting the sealed route adapter made both fail as expected. Scoped formatter checks passed.

References

Apache Pekko HTTP #967 and RouteTest.toFunctionPassThroughExceptions.

Motivation: The unsealed RouteTest adapter is meant to preserve failures, but its synchronous and asynchronous paths did not have direct assertions.

Modification: Call the real RouteTest helper and assert that synchronous throw and asynchronous failure expose the original exception instance.

Result: On Scala 2.13.18 and JDK 21 the two new cases passed against the actual tester and routing code. Substituting the sealed route adapter made both fail as expected. Scoped formatter checks passed.

References: Apache Pekko HTTP apache#967 and RouteTest.toFunctionPassThroughExceptions.
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.

1 participant