Exception during PowerMock of HConnectionManager.class (HBase)
<ol>
<li><code>PowerMockito.mockStatic(HConnectionManager.class);</code></li>
<li><code>when(HConnectionManager.createConnection(configuration)).thenReturn(hConnection)</code></li>
</ol>

<p>What are the ways to mock HBase related configuration files? As I get:</p>

<pre><code>java.lang.ExceptionInInitializerError
    at com.mapr.fs.ShimLoader.load(ShimLoader.java:214)
    at org.apache.hadoop.conf.CoreDefaultProperties.&lt;clinit&gt;(CoreDefaultProperties.java:60)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:274)
    at org.apache.hadoop.conf.Configuration.getClassByNameOrNull(Configuration.java:1857)
    at org.apache.hadoop.conf.Configuration.getProperties(Configuration.java:2072)
    at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2282)
    at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2234)
    at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2151)
    at org.apache.hadoop.conf.Configuration.get(Configuration.java:871)
    at org.apache.hadoop.conf.Configuration.getTrimmed(Configuration.java:890)
    at org.apache.hadoop.conf.Configuration.getBoolean(Configuration.java:1291)
    at org.apache.hadoop.hbase.HBaseConfiguration.checkDefaultsVersion(HBaseConfiguration.java:71)
    at org.apache.hadoop.hbase.HBaseConfiguration.addHbaseResources(HBaseConfiguration.java:107)
    at org.apache.hadoop.hbase.HBaseConfiguration.create(HBaseConfiguration.java:118)
    at org.apache.hadoop.hbase.client.HConnectionManager.&lt;clinit&gt;(HConnectionManager.java:266)
    at sun.reflect.GeneratedSerializationConstructorAccessor35.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.newInstance(SunReflectionFactoryInstantiator.java:45)
    at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:73)
    at org.mockito.internal.creation.instance.ObjenesisInstantiator.newInstance(ObjenesisInstantiator.java:14)
    at org.powermock.api.mockito.repackaged.ClassImposterizer.createProxy(ClassImposterizer.java:143)
    at org.powermock.api.mockito.repackaged.ClassImposterizer.imposterise(ClassImposterizer.java:58)
    at org.powermock.api.mockito.repackaged.ClassImposterizer.imposterise(ClassImposterizer.java:49)
    at org.powermock.api.mockito.repackaged.CglibMockMaker.createMock(CglibMockMaker.java:24)
    at org.powermock.api.mockito.internal.mockmaker.PowerMockMaker.createMock(PowerMockMaker.java:46)
    at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:33)
    at org.mockito.internal.MockitoCore.mock(MockitoCore.java:59)
    at org.mockito.Mockito.mock(Mockito.java:1285)
    at org.mockito.Mockito.mock(Mockito.java:1163)
</code></pre>