3434import  java .util .jar .JarEntry ;
3535import  java .util .jar .JarInputStream ;
3636import  java .util .jar .JarOutputStream ;
37+ import  java .util .stream .Stream ;
38+ 
3739import  org .apache .commons .io .IOUtils ;
3840import  org .apache .logging .log4j .core .config .plugins .processor .PluginCache ;
3941import  org .apache .logging .log4j .core .config .plugins .processor .PluginEntry ;
4244import  org .junit .jupiter .api .AfterAll ;
4345import  org .junit .jupiter .api .BeforeAll ;
4446import  org .junit .jupiter .api .Test ;
47+ import  org .junit .jupiter .params .ParameterizedTest ;
48+ import  org .junit .jupiter .params .provider .Arguments ;
49+ import  org .junit .jupiter .params .provider .MethodSource ;
4550
4651final  class  Log4j2PluginCacheFileTransformerTest  {
4752
@@ -110,16 +115,9 @@ private void assertTransformedCacheFile(
110115        }
111116    }
112117
113-     @ Test 
114-     public  void  testRelocation () throws  IOException  {
115-         // test with matching relocator 
116-         testRelocation ("org.apache.logging" , "new.location.org.apache.logging" , "new.location.org.apache.logging" );
117- 
118-         // test without matching relocator 
119-         testRelocation ("com.apache.logging" , "new.location.com.apache.logging" , "org.apache.logging" );
120-     }
121- 
122-     private  void  testRelocation (final  String  src , final  String  pattern , final  String  target ) throws  IOException  {
118+     @ ParameterizedTest 
119+     @ MethodSource ("relocationParameters" )
120+     public  void  testRelocation (final  String  src , final  String  pattern , final  String  target ) throws  IOException  {
123121        final  Log4j2PluginCacheFileTransformer  transformer  = new  Log4j2PluginCacheFileTransformer ();
124122        final  Relocator  log4jRelocator  = new  SimpleRelocator (src , pattern , null , null );
125123        final  PluginCache  aggregator  = new  PluginCache ();
@@ -135,6 +133,15 @@ private void testRelocation(final String src, final String pattern, final String
135133        }
136134    }
137135
136+     private  static  Stream <Arguments > relocationParameters () {
137+         return  Stream .of (
138+                 // test with matching relocator 
139+                 Arguments .of ("org.apache.logging" , "new.location.org.apache.logging" , "new.location.org.apache.logging" ),
140+                 // test without matching relocator 
141+                 Arguments .of ("com.apache.logging" , "new.location.com.apache.logging" , "org.apache.logging" )
142+         );
143+     }
144+ 
138145    @ AfterAll 
139146    public  static  void  tearDown () {
140147        pluginUrl  = null ;
0 commit comments