Skip to content

Migrate ScpWagonWithProxyTest off PlexusTestCase - #933

Merged
slachiewicz merged 1 commit into
wagon-3.xfrom
junit5-scp-proxy-test-3x
Aug 18, 2026
Merged

Migrate ScpWagonWithProxyTest off PlexusTestCase#933
slachiewicz merged 1 commit into
wagon-3.xfrom
junit5-scp-proxy-test-3x

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Backport of #931. This branch's copy was byte-identical to master's before its migration, so master's
result is taken verbatim; the pom drift between the branches is only the version line, so the three
dependencies are replayed rather than the file lifted.

Unlike the other providers migrated so far, this one genuinely needs a container. AbstractJschWagon
declares knownHostsProvider (@Named("file")), interactiveUserInfo and uIKeyboardInteractive
with @Inject; constructing the wagon directly would leave all three null and the test would keep
passing while exercising something different. Hence plexus-testing with @Inject @Named("scp"), and
PlexusTestConfiguration to carry over the SCANNING_INDEX setting the sisu-annotated providers need.

wagon-ssh also gains junit-vintage-engine: ScpWagonTest, SftpWagonTest,
EmbeddedScpWagonWithKeyTest, SshCommandExecutorTest and ScpWagonWithSshPrivateKeySearchTest still
inherit their test methods from the published WagonTestCase.

Verification, including its limit

This module excludes every one of its test classes from surefire — **/ScpWagon*Test.* covers this
one — so mvn test in wagon-ssh runs nothing and reports success either way. Passing -Dtest
overrides the exclusion, which makes a real comparison possible on this branch:

cases errors failures
before 2 0 2
after 2 0 2

Identical, matching what #931 measured on master. Both fail on assertTrue(handled) because the proxy
is never reached without an ssh server present, which is what the exclusions exist for.

That identity is also the evidence that the injection works: had @Inject @Named("scp") not resolved,
the run would have produced NPE errors, not the same two assertion failures — the test only
reaches that assertion after wagon.connect(...) has thrown AuthenticationException.

This change was created with AI assistance.

Backport of the same change on master; this branch's copy was
byte-identical to master's before its migration.

This one needs a real container, unlike the other providers:
AbstractJschWagon declares knownHostsProvider, interactiveUserInfo and
uIKeyboardInteractive with @Inject, so constructing the wagon directly
would leave them null and the test would keep passing while exercising
something else.

wagon-ssh also gains junit-vintage-engine: five tests here still inherit
their methods from the published WagonTestCase.
@slachiewicz
slachiewicz marked this pull request as ready for review August 18, 2026 09:42
@slachiewicz
slachiewicz merged commit e392955 into wagon-3.x Aug 18, 2026
6 checks passed
@slachiewicz
slachiewicz deleted the junit5-scp-proxy-test-3x branch August 18, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant