java.lang.VerifyError: Expecting a stackmap frame at branch, when using PowerMockRunner
<p>I upgraded the MRUnit version to 1.1.0 in my project, to use the ReduceDriver for testing multiple outputs. After making changes to my test (to make it work with the upgrade), I get this error:</p>

<pre><code>java.lang.VerifyError: Expecting a stackmap frame at branch target 63
Exception Details:
Location: (path to test class)
Reason: Expected stackmap frame at this location.
Bytecode: (Bytecode)
</code></pre>

<p>My test looks like this (have deliberately removed code to make this more concise):</p>

<pre><code>@RunWith(PowerMockRunner.class)
@PrepareForTest(MultipleOutputs.class)
public class myReducerTest {
   private ReduceDriver&lt;Text, Text, Text, Text&gt; reduceDriver;

   @Before
   public void setUp() {
       reduceDriver = ReduceDriver.newReduceDriver(new myReducer());
   }

   @Test
   public void testHappyPath() throws IOException {
       /*
          Code to declare input key, inout value, expected output, etc.
       */

       reduceDriver.withInput(myInputKey, myInputVal);
       reduceDriver.withMultiOutput("reportName1", key, expectedValue1);
       reduceDriver.withMultiOutput("reportName2", key, expectedValue2);
       reduceDriver.runTest();
   }
}
</code></pre>

<p>I get the error when I use @PrepareForTest. Note that <strong>myReducer</strong> class has no static or final methods. That is why it is not included in @PrepareForTest annotation. Part of my pom file (I am using maven for building) looks like this:</p>

<pre><code>    &lt;dependency&gt;
        &lt;groupId&gt;org.mockito&lt;/groupId&gt;
        &lt;artifactId&gt;mockito-all&lt;/artifactId&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.powermock&lt;/groupId&gt;
        &lt;artifactId&gt;powermock-api-mockito&lt;/artifactId&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.powermock&lt;/groupId&gt;
        &lt;artifactId&gt;powermock-core&lt;/artifactId&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.powermock&lt;/groupId&gt;
        &lt;artifactId&gt;powermock-api-easymock&lt;/artifactId&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.powermock&lt;/groupId&gt;
        &lt;artifactId&gt;powermock-module-junit4&lt;/artifactId&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.apache.mrunit&lt;/groupId&gt;
        &lt;artifactId&gt;mrunit&lt;/artifactId&gt;
        &lt;version&gt;1.1.0&lt;/version&gt;
        &lt;classifier&gt;hadoop2&lt;/classifier&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
</code></pre>

<p>Also note that I am using Java 8, and cannot downgrade to v7 or v6 as mentioned here: <a href="https://stackoverflow.com/questions/26733946/java-lang-verifyerror-expecting-a-stackmap-frame-at-branch-target">java.lang.VerifyError: Expecting a stackmap frame at branch target</a></p>

<p>I also tried adding the surefire plugin in the pom file, as mentioned here:
<a href="https://stackoverflow.com/questions/24987818/java-lang-verifyerror-expecting-a-stackmap-frame-at-branch-target-73">java.lang.VerifyError: Expecting a stackmap frame at branch target 73</a></p>

<p>None of these solutions work in this case.</p>