/** * Sets {@link #serviceMethodSignature}. * * @param serviceMethodSignature * New value for {@link #serviceMethodSignature} */ public void setServiceMethodSignature(String serviceMethodSignature) { this.serviceMethodSignature = serviceMethodSignature; // set also to the cause Throwable cause = getCause(); if (cause instanceof RemoteException) { ((RemoteException) cause).setServiceMethodSignature(serviceMethodSignature); } }
e.setServiceMethodSignature(jp.getSignature().toString()); transformException.setServiceMethodSignature(jp.getSignature().toString());
@Test(expectedExceptions = { RemoteException.class }) public void remoteException() throws Throwable { String methodSignature = "methodSignature"; RemoteException remoteException = mock(RemoteException.class); when(jp.proceed()).thenThrow(remoteException); when(signature.toString()).thenReturn(methodSignature); try { interceptor.logServiceException(jp); } finally { verify(jp, times(1)).proceed(); verify(remoteException, times(1)).setServiceMethodSignature(methodSignature); verify(log, times(1)).warn(anyString(), eq(remoteException)); } }