Merge branch 'BAEL-3504' of https://github.com/vikasrajput6035/tutorials into BAEL-3504
This commit is contained in:
commit
3771a056b3
@ -11,7 +11,7 @@ import org.junit.jupiter.api.Test;
|
|||||||
public class InvocationTargetUnitTest {
|
public class InvocationTargetUnitTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenCallingMethodThrowsException_thenAssertTrue() throws Exception {
|
public void whenCallingMethodThrowsException_thenAssertCauseOfInvocationTargetException() throws Exception {
|
||||||
InvocationTargetExample targetExample = new InvocationTargetExample();
|
InvocationTargetExample targetExample = new InvocationTargetExample();
|
||||||
Method method = InvocationTargetExample.class.getMethod("divideByZeroExample");
|
Method method = InvocationTargetExample.class.getMethod("divideByZeroExample");
|
||||||
Exception exception = assertThrows(InvocationTargetException.class, () -> method.invoke(targetExample));
|
Exception exception = assertThrows(InvocationTargetException.class, () -> method.invoke(targetExample));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user