Home | History | Annotate | Download | only in base
      1 /*
      2  * Copyright (c) 2007 Mockito contributors
      3  * This program is made available under the terms of the MIT License.
      4  */
      5 
      6 package org.mockito.exceptions.base;
      7 
      8 import org.junit.Test;
      9 import org.mockitoutil.TestBase;
     10 
     11 import static org.junit.Assert.assertEquals;
     12 import static org.junit.Assert.fail;
     13 
     14 public class MockitoExceptionTest extends TestBase {
     15 
     16     private void throwIt() {
     17         throw new MockitoException("boom");
     18     }
     19 
     20     @Test
     21     public void shouldKeepUnfilteredStackTrace() {
     22         try {
     23             throwIt();
     24             fail();
     25         } catch (MockitoException e) {
     26             assertEquals("throwIt", e.getUnfilteredStackTrace()[0].getMethodName());
     27         }
     28     }
     29 }
     30