e.setServiceMethodSignature(jp.getSignature().toString());
@Test(expectedExceptions = { BusinessException.class }) public void businessException() throws Throwable { String methodSignature = "methodSignature"; BusinessException businessException = mock(BusinessException.class); when(jp.proceed()).thenThrow(businessException); when(signature.toString()).thenReturn(methodSignature); try { interceptor.logServiceException(jp); } finally { verify(jp, times(1)).proceed(); verify(businessException, times(1)).setServiceMethodSignature(methodSignature); } }