Polishing
This commit is contained in:
@@ -77,9 +77,7 @@ public class ThrowsAdviceInterceptorTests {
|
||||
given(mi.getMethod()).willReturn(Object.class.getMethod("hashCode"));
|
||||
given(mi.getThis()).willReturn(new Object());
|
||||
given(mi.proceed()).willThrow(ex);
|
||||
assertThatExceptionOfType(FileNotFoundException.class).isThrownBy(() ->
|
||||
ti.invoke(mi))
|
||||
.isSameAs(ex);
|
||||
assertThatExceptionOfType(FileNotFoundException.class).isThrownBy(() -> ti.invoke(mi)).isSameAs(ex);
|
||||
assertThat(th.getCalls()).isEqualTo(1);
|
||||
assertThat(th.getCalls("ioException")).isEqualTo(1);
|
||||
}
|
||||
@@ -92,9 +90,7 @@ public class ThrowsAdviceInterceptorTests {
|
||||
ConnectException ex = new ConnectException("");
|
||||
MethodInvocation mi = mock();
|
||||
given(mi.proceed()).willThrow(ex);
|
||||
assertThatExceptionOfType(ConnectException.class).isThrownBy(() ->
|
||||
ti.invoke(mi))
|
||||
.isSameAs(ex);
|
||||
assertThatExceptionOfType(ConnectException.class).isThrownBy(() -> ti.invoke(mi)).isSameAs(ex);
|
||||
assertThat(th.getCalls()).isEqualTo(1);
|
||||
assertThat(th.getCalls("remoteException")).isEqualTo(1);
|
||||
}
|
||||
@@ -117,9 +113,7 @@ public class ThrowsAdviceInterceptorTests {
|
||||
ConnectException ex = new ConnectException("");
|
||||
MethodInvocation mi = mock();
|
||||
given(mi.proceed()).willThrow(ex);
|
||||
assertThatExceptionOfType(Throwable.class).isThrownBy(() ->
|
||||
ti.invoke(mi))
|
||||
.isSameAs(t);
|
||||
assertThatExceptionOfType(Throwable.class).isThrownBy(() -> ti.invoke(mi)).isSameAs(t);
|
||||
assertThat(th.getCalls()).isEqualTo(1);
|
||||
assertThat(th.getCalls("remoteException")).isEqualTo(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user