slachiewicz opened a new pull request, #931:
URL: https://github.com/apache/maven-wagon/pull/931

   The last `PlexusTestCase` in `wagon-ssh`.
   
   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. So it 
moves to `plexus-testing` with
   `@Inject @Named("scp")`, and implements `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`, and surefire 
provisions the jupiter
   engine but not the vintage one.
   
   ### 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:
   
   | | cases | errors | failures |
   |---|---|---|---|
   | before | 2 | 0 | 2 |
   | after | 2 | 0 | 2 |
   
   Identical. 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.*


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to