1818 */
1919package org .apache .maven .buildcache .xml ;
2020
21- import org .apache .maven .buildcache .xml .config .TrackedProperty ;
22- import org .junit .jupiter .api .Test ;
23-
24- import java .util .List ;
2521import java .util .Set ;
2622import java .util .stream .Collectors ;
2723
24+ import org .junit .jupiter .api .Test ;
25+
2826import static org .junit .jupiter .api .Assertions .assertNotNull ;
2927import static org .junit .jupiter .api .Assertions .assertTrue ;
3028
@@ -41,59 +39,63 @@ void testMavenCompilerPluginAutoTracksAllFunctionalParameters() {
4139
4240 PluginParameterLoader loader = new PluginParameterLoader ();
4341 PluginParameterDefinition def = loader .load ("maven-compiler-plugin" );
44-
42+
4543 assertNotNull (def , "Should load maven-compiler-plugin definition" );
46-
44+
4745 PluginParameterDefinition .GoalParameterDefinition compileGoal = def .getGoal ("compile" );
4846 assertNotNull (compileGoal , "compile goal should exist" );
49-
47+
5048 // Get all functional parameter names from the XML definition
5149 Set <String > functionalParams = compileGoal .getParameters ().values ().stream ()
5250 .filter (PluginParameterDefinition .ParameterDefinition ::isFunctional )
5351 .map (PluginParameterDefinition .ParameterDefinition ::getName )
5452 .collect (Collectors .toSet ());
55-
53+
5654 // Verify we have more than just the original 3 from defaults.xml
57- assertTrue (functionalParams .size () > 3 ,
55+ assertTrue (
56+ functionalParams .size () > 3 ,
5857 "Should have more than 3 functional parameters (was: " + functionalParams .size () + ")" );
59-
58+
6059 // Verify the original 3 are included
6160 assertTrue (functionalParams .contains ("source" ), "Should include 'source' parameter" );
6261 assertTrue (functionalParams .contains ("target" ), "Should include 'target' parameter" );
6362 assertTrue (functionalParams .contains ("release" ), "Should include 'release' parameter" );
64-
63+
6564 // Verify additional functional parameters are included (these were NOT in defaults.xml)
66- assertTrue (functionalParams .contains ("encoding" ),
65+ assertTrue (
66+ functionalParams .contains ("encoding" ),
6767 "Should include 'encoding' parameter (auto-tracked, not in old defaults.xml)" );
68- assertTrue (functionalParams .contains ("debug" ),
68+ assertTrue (
69+ functionalParams .contains ("debug" ),
6970 "Should include 'debug' parameter (auto-tracked, not in old defaults.xml)" );
70- assertTrue (functionalParams .contains ("compilerArgs" ),
71+ assertTrue (
72+ functionalParams .contains ("compilerArgs" ),
7173 "Should include 'compilerArgs' parameter (auto-tracked, not in old defaults.xml)" );
72- assertTrue (functionalParams .contains ("annotationProcessorPaths" ),
74+ assertTrue (
75+ functionalParams .contains ("annotationProcessorPaths" ),
7376 "Should include 'annotationProcessorPaths' parameter (auto-tracked, not in old defaults.xml)" );
7477 }
7578
7679 @ Test
7780 void testMavenInstallPluginAutoTracksAllFunctionalParameters () {
7881 PluginParameterLoader loader = new PluginParameterLoader ();
7982 PluginParameterDefinition def = loader .load ("maven-install-plugin" );
80-
83+
8184 assertNotNull (def , "Should load maven-install-plugin definition" );
82-
85+
8386 PluginParameterDefinition .GoalParameterDefinition installGoal = def .getGoal ("install" );
8487 assertNotNull (installGoal , "install goal should exist" );
85-
88+
8689 // Get all functional parameter names
8790 Set <String > functionalParams = installGoal .getParameters ().values ().stream ()
8891 .filter (PluginParameterDefinition .ParameterDefinition ::isFunctional )
8992 .map (PluginParameterDefinition .ParameterDefinition ::getName )
9093 .collect (Collectors .toSet ());
91-
94+
9295 // The old defaults.xml had NO properties listed for maven-install-plugin
9396 // Now auto-tracking should track all functional parameters
94- assertTrue (functionalParams .size () > 0 ,
95- "Should auto-track functional parameters (old defaults.xml had 0)" );
96-
97+ assertTrue (functionalParams .size () > 0 , "Should auto-track functional parameters (old defaults.xml had 0)" );
98+
9799 // Verify key functional parameters are tracked
98100 assertTrue (functionalParams .contains ("file" ), "Should track 'file' parameter" );
99101 assertTrue (functionalParams .contains ("groupId" ), "Should track 'groupId' parameter" );
@@ -105,22 +107,22 @@ void testMavenInstallPluginAutoTracksAllFunctionalParameters() {
105107 void testBehavioralParametersNotAutoTracked () {
106108 PluginParameterLoader loader = new PluginParameterLoader ();
107109 PluginParameterDefinition def = loader .load ("maven-compiler-plugin" );
108-
110+
109111 assertNotNull (def );
110-
112+
111113 PluginParameterDefinition .GoalParameterDefinition compileGoal = def .getGoal ("compile" );
112114 assertNotNull (compileGoal );
113-
115+
114116 // Get all behavioral parameter names
115117 Set <String > behavioralParams = compileGoal .getParameters ().values ().stream ()
116118 .filter (PluginParameterDefinition .ParameterDefinition ::isBehavioral )
117119 .map (PluginParameterDefinition .ParameterDefinition ::getName )
118120 .collect (Collectors .toSet ());
119-
121+
120122 // Verify behavioral parameters exist in the definition
121123 assertTrue (behavioralParams .contains ("verbose" ), "Definition should include 'verbose' as behavioral" );
122124 assertTrue (behavioralParams .contains ("fork" ), "Definition should include 'fork' as behavioral" );
123-
125+
124126 // Note: The auto-generation logic in CacheConfigImpl.generateReconciliationFromParameters()
125127 // filters to only include functional parameters, so behavioral ones won't be tracked
126128 }
0 commit comments