From 910ac808c8c079cd22efe1ef7a95e10fc73883a5 Mon Sep 17 00:00:00 2001 From: Vikas Ramsingh Rajput Date: Sun, 19 Jan 2020 11:56:33 +0300 Subject: [PATCH] BAEL-3504: Added blank lines before when and then in unit test --- .../exception/invocationtarget/InvocationTargetUnitTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core-java-modules/core-java-reflection/src/test/java/com/baeldung/reflection/exception/invocationtarget/InvocationTargetUnitTest.java b/core-java-modules/core-java-reflection/src/test/java/com/baeldung/reflection/exception/invocationtarget/InvocationTargetUnitTest.java index f7297b0f0b..b4cabebcef 100644 --- a/core-java-modules/core-java-reflection/src/test/java/com/baeldung/reflection/exception/invocationtarget/InvocationTargetUnitTest.java +++ b/core-java-modules/core-java-reflection/src/test/java/com/baeldung/reflection/exception/invocationtarget/InvocationTargetUnitTest.java @@ -12,9 +12,12 @@ public class InvocationTargetUnitTest { @Test public void whenCallingMethodThrowsException_thenAssertCauseOfInvocationTargetException() throws Exception { + InvocationTargetExample targetExample = new InvocationTargetExample(); Method method = InvocationTargetExample.class.getMethod("divideByZeroExample"); + Exception exception = assertThrows(InvocationTargetException.class, () -> method.invoke(targetExample)); + assertEquals(ArithmeticException.class, exception.getCause().getClass()); } }