Migrate HttpWagonHttpServerTestCase and its subclasses off PlexusTestCase - #932
Merged
Merged
Conversation
…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.
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 #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 isHttpWagon, andAbstractHttpClientWagondeclares no injected collaborators.Two details worth a look, same as on master:
startTestServer. Left assetUp(), the subclasses' ownsetUp()would override it and JUnit 5 would run only the override, so the Jetty server would neverbe created. With distinct names JUnit 5 runs the superclass
@BeforeEachfirst in its own right andthe subclasses drop their
super.setUp()call.getName()came fromjunit.framework.TestCaseand feeds sixFileTestUtils.createUniqueFilecallsites; it now comes from an injected
TestInfo, leaving those unchanged.Verified:
mvn testonwagon-http, counting<testcase>elements per class — 295 before and after,2 skipped in both, zero failures.
HttpWagonErrorTeststays at 5 andHttpWagonTimeoutTestat 4,which is what shows the base setup still runs.
This change was created with AI assistance.