### Question:
NeverTransactionInterceptor extends AbstractTransactionAttributeInterceptor { @AroundInvoke public Object checkTransaction(InvocationContext ic) throws Exception { checkTransactionActive(); return ic.proceed(); }  @AroundInvoke Object checkTransaction(InvocationContext ic);  }### Answer:
@Test(expected = EJBException.class) public void activeTransaction() throws Exception { transactionFactory.expectActiveTransaction(); transactionFactory.replay(); try { InvocationContext ic = createNiceMock(InvocationContext.class); expect(ic.proceed()).andThrow(new ApplicationException()); replay(ic); interceptor.checkTransaction(ic); } catch (InvocationTargetException e) { if (e.getTargetException() instanceof Error) { throw (Error) e.getTargetException(); } else { throw (Exception) e.getTargetException(); } } finally { transactionFactory.verify(); } }
@Test(expected = ApplicationException.class) public void noTransaction() throws Exception { transactionFactory.expectNoTransaction(); transactionFactory.replay(); try { InvocationContext ic = createNiceMock(InvocationContext.class); expect(ic.proceed()).andThrow(new ApplicationException()); replay(ic); interceptor.checkTransaction(ic); } finally { transactionFactory.verify(); } }