Skip to content

Migrate HttpWagonHttpServerTestCase and its subclasses off PlexusTestCase - #932

Merged
slachiewicz merged 1 commit into
wagon-3.xfrom
junit5-http-server-testcase-3x
Aug 18, 2026
Merged

Migrate HttpWagonHttpServerTestCase and its subclasses off PlexusTestCase#932
slachiewicz merged 1 commit into
wagon-3.xfrom
junit5-http-server-testcase-3x

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Backport of #930. This branch's three copies were byte-identical to master's before its migration, so
master's result is taken verbatim.

No new dependency: the container was only supplying Wagon.ROLE, which is HttpWagon, and
AbstractHttpClientWagon declares no injected collaborators.

Two details worth a look, same as on master:

  • The base lifecycle method is renamed startTestServer. Left as setUp(), the subclasses' own
    setUp() would override it and JUnit 5 would run only the override, so the Jetty server would never
    be created. With distinct names JUnit 5 runs the superclass @BeforeEach first in its own right and
    the subclasses drop their super.setUp() call.
  • getName() came from junit.framework.TestCase and feeds six FileTestUtils.createUniqueFile call
    sites; it now comes from an injected TestInfo, leaving those unchanged.

Verified: mvn test on wagon-http, counting <testcase> elements per class — 295 before and after,
2 skipped in both, zero failures. HttpWagonErrorTest stays at 5 and HttpWagonTimeoutTest at 4,
which is what shows the base setup still runs.

This change was created with AI assistance.

…Case

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

The base lifecycle method is renamed startTestServer so a subclass
@beforeeach cannot override it: with the same signature JUnit 5 would run
only the override and the server would never be created. getName() came
from junit.framework.TestCase and now comes from an injected TestInfo.
@slachiewicz
slachiewicz marked this pull request as ready for review August 18, 2026 09:40
@slachiewicz
slachiewicz merged commit 4ed66be into wagon-3.x Aug 18, 2026
6 checks passed
@slachiewicz
slachiewicz deleted the junit5-http-server-testcase-3x branch August 18, 2026 10:30
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