1012e1
From d0bc26194a0e432206d7f92cf0b6fbef67946cc4 Mon Sep 17 00:00:00 2001
1012e1
From: Marian Koncek <mkoncek@redhat.com>
1012e1
Date: Thu, 5 Sep 2019 15:21:04 +0200
1012e1
Subject: [PATCH 4/6] Remove dependency on powermock
1012e1
1012e1
---
1012e1
 .../StringSearchModelInterpolatorTest.java    | 66 -------------------
1012e1
 1 file changed, 66 deletions(-)
1012e1
1012e1
diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java
1012e1
index c95e37271..aafafa52f 100644
1012e1
--- a/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java
1012e1
+++ b/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java
1012e1
@@ -36,8 +36,6 @@
1012e1
 import static org.hamcrest.CoreMatchers.anyOf;
1012e1
 import static org.hamcrest.CoreMatchers.is;
1012e1
 import static org.junit.Assert.assertThat;
1012e1
-import static org.powermock.reflect.Whitebox.getField;
1012e1
-import static org.powermock.reflect.Whitebox.getInternalState;
1012e1
 
1012e1
 /**
1012e1
  * @author jdcasey
1012e1
@@ -375,70 +373,6 @@ public void testInterpolateObjectWithPomFile()
1012e1
         ) ) );
1012e1
     }
1012e1
 
1012e1
-    public void testNotInterpolateObjectWithFile()
1012e1
-            throws Exception
1012e1
-    {
1012e1
-        Model model = new Model();
1012e1
-
1012e1
-        File baseDir = new File( System.getProperty( "user.dir" ) );
1012e1
-
1012e1
-        Properties p = new Properties();
1012e1
-
1012e1
-        ObjectWithNotInterpolatedFile obj = new ObjectWithNotInterpolatedFile( baseDir );
1012e1
-
1012e1
-        StringSearchModelInterpolator interpolator = (StringSearchModelInterpolator) createInterpolator();
1012e1
-
1012e1
-        ModelBuildingRequest config = createModelBuildingRequest( p );
1012e1
-
1012e1
-        SimpleProblemCollector collector = new SimpleProblemCollector();
1012e1
-        interpolator.interpolateObject( obj, model, new File( "." ), config, collector );
1012e1
-        assertProblemFree( collector );
1012e1
-
1012e1
-        //noinspection unchecked
1012e1
-        Map<Class<?>, ?> cache =
1012e1
-                (Map<Class<?>, ?>) getField( StringSearchModelInterpolator.class, "CACHED_ENTRIES" )
1012e1
-                        .get( null );
1012e1
-
1012e1
-        Object objCacheItem = cache.get( Object.class );
1012e1
-        Object fileCacheItem = cache.get( File.class );
1012e1
-
1012e1
-        assertNotNull( objCacheItem );
1012e1
-        assertNotNull( fileCacheItem );
1012e1
-
1012e1
-        assertThat( ( (Object[]) getInternalState( objCacheItem, "fields" ) ).length, is( 0 ) );
1012e1
-        assertThat( ( (Object[]) getInternalState( fileCacheItem, "fields" ) ).length, is( 0 ) );
1012e1
-    }
1012e1
-
1012e1
-    public void testNotInterpolateFile()
1012e1
-            throws Exception
1012e1
-    {
1012e1
-        Model model = new Model();
1012e1
-
1012e1
-        File baseDir = new File( System.getProperty( "user.dir" ) );
1012e1
-
1012e1
-        Properties p = new Properties();
1012e1
-
1012e1
-        StringSearchModelInterpolator interpolator = (StringSearchModelInterpolator) createInterpolator();
1012e1
-
1012e1
-        ModelBuildingRequest config = createModelBuildingRequest( p );
1012e1
-
1012e1
-        SimpleProblemCollector collector = new SimpleProblemCollector();
1012e1
-        interpolator.interpolateObject( baseDir, model, new File( "." ), config, collector );
1012e1
-        assertProblemFree( collector );
1012e1
-
1012e1
-        //noinspection unchecked
1012e1
-        Map<Class<?>, ?> cache =
1012e1
-                (Map<Class<?>, ?>) getField( StringSearchModelInterpolator.class, "CACHED_ENTRIES" )
1012e1
-                        .get( null );
1012e1
-
1012e1
-        Object fileCacheItem = cache.get( File.class );
1012e1
-
1012e1
-        assertNotNull( fileCacheItem );
1012e1
-
1012e1
-        assertThat( ( (Object[]) getInternalState( fileCacheItem, "fields" ) ).length, is( 0 ) );
1012e1
-    }
1012e1
-
1012e1
-
1012e1
     public void testConcurrentInterpolation()
1012e1
         throws Exception
1012e1
     {
1012e1
-- 
1012e1
2.35.1
1012e1