title: Events in junit with Mockito
body: <p>I try to test javax.enterprise.event.Event mocked by mockito but the following exception is thrown</p>
  
  <pre><code>Absent Code attribute in method that is not native or abstract in class file javax/enterprise/util/TypeLiteral
  </code></pre>
  
  <p>The class looks like</p>
  
  <pre><code>public class MyClassTest {
      @Mock Event&lt;MyAlarm&gt; event;
      //...
      @Before
      public void setUp() {
          MockitoAnnotations.initMocks(this);
      //...
      }
      @Test
      public void myTest() {
          MyClass myClass = new MyClass();
          myClass.event = event;
          //...
          verify(event, never()).fire(any(MyAlarm.class));
          //...
      }
  }
  </code></pre>
  
  <p>I add following to the pom.xml (maven project)</p>
  
  <pre><code>    &lt;repository&gt;
          &lt;id&gt;glassfish&lt;/id&gt;
          &lt;name&gt;GlassFish Maven Repository&lt;/name&gt;
          &lt;url&gt;http://maven.glassfish.org/content/groups/glassfish&lt;/url&gt;
      &lt;/repository&gt;
  </code></pre>
  
  <p>and include the glassfish-embedded-all in front of the javax (javaee-web-api) dependency</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish.extras&lt;/groupId&gt;
          &lt;artifactId&gt;glassfish-embedded-all&lt;/artifactId&gt;
          &lt;version&gt;3.1&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax&lt;/groupId&gt;
          &lt;artifactId&gt;javaee-web-api&lt;/artifactId&gt;
          &lt;version&gt;6.0&lt;/version&gt;
          &lt;type&gt;jar&lt;/type&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>What I have done wrong or what do I misunderstand?</p>