Repository navigation
WW-3447 test(convention): cover action-mapping flags with no tests - #2003
Merged
Merged
Conversation
Add on/off tests for alwaysMapExecute, checkImplementsAction, mapAllMatches, disableScanning, package.locators.disable and eagerLoading in PackageBasedActionConfigBuilderTest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.



Fixes WW-3447
Summary
The ticket (2010) says the convention plugin has no tests. That is no longer true: the plugin has 16 test classes. Some of the constants in
struts-plugin.xmlwere still never set in any test, though, so only their default value was ever exercised. This PR adds an on/off test pair for the six that change how actions get mapped:struts.convention.action.alwaysMapExecuteexecute()next to an@Actionmethod is not mappedstruts.convention.action.checkImplementsActionActionimplementor without the suffix is mappedstruts.convention.action.mapAllMatchesexecute()is not mappedstruts.convention.action.disableScanningstruts.convention.package.locators.disablestruts.convention.action.eagerLoadingObjectFactorydoes not load action classesThe new tests sit in
PackageBasedActionConfigBuilderTest, which already uses the JUnit 3 style, and use three fixture classes underorg.apache.struts2.convention.flags.*.Three constants are left out on purpose:
classes.reload,includeJarsandexclude.parentClassLoader. They depend on classloaders and jar scanning, and a unit test wouldn't prove much about them.Verification
./mvnw test -DskipAssembly -pl plugins/conventionpasses.PackageBasedActionConfigBuildertotrueand then tofalse(12 runs). Every run failed the test written for that flag. The production code is unchanged in this PR.Test-only change; no production code touched.
🤖 Generated with Claude Code