diff --git a/testing-modules/junit-5-basics/src/test/java/com/baeldung/ExceptionUnitTest.java b/testing-modules/junit-5-basics/src/test/java/com/baeldung/ExceptionUnitTest.java index 7b7c11ccad..a191d941a9 100644 --- a/testing-modules/junit-5-basics/src/test/java/com/baeldung/ExceptionUnitTest.java +++ b/testing-modules/junit-5-basics/src/test/java/com/baeldung/ExceptionUnitTest.java @@ -17,7 +17,8 @@ class ExceptionUnitTest { Throwable exception = assertThrows(UnsupportedOperationException.class, () -> { throw new UnsupportedOperationException("Not supported"); }); - assertEquals(exception.getMessage(), "Not supported"); + + assertEquals("Not supported", exception.getMessage()); } @Test