Migrate ScpWagonWithProxyTest off PlexusTestCase - #933
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
AbstractJschWagondeclares
knownHostsProvider(@Named("file")),interactiveUserInfoanduIKeyboardInteractivewith
@Inject; constructing the wagon directly would leave all three null and the test would keeppassing while exercising something different. Hence
plexus-testingwith@Inject @Named("scp"), andPlexusTestConfigurationto carry over theSCANNING_INDEXsetting the sisu-annotated providers need.wagon-sshalso gainsjunit-vintage-engine:ScpWagonTest,SftpWagonTest,EmbeddedScpWagonWithKeyTest,SshCommandExecutorTestandScpWagonWithSshPrivateKeySearchTeststillinherit 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 thisone — so
mvn testinwagon-sshruns nothing and reports success either way. Passing-Dtestoverrides the exclusion, which makes a real comparison possible on this branch:
Identical, matching what #931 measured on master. Both fail on
assertTrue(handled)because the proxyis 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 thrownAuthenticationException.This change was created with AI assistance.