[JAVA-16711] Remove unnecessary system out logging
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
package com.baeldung.exception.exceptions_vs_errors;
|
||||
|
||||
public class ErrorExample {
|
||||
|
||||
public static void main(String[] args) {
|
||||
overflow();
|
||||
}
|
||||
|
||||
public static void overflow() {
|
||||
System.out.println("overflow...");
|
||||
overflow();
|
||||
public static void main(String[] args) {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,11 +3,11 @@ package com.baeldung.exception.exceptions_vs_errors;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
|
||||
// Unit test for the ErrorExample class.
|
||||
public class ErrorExampleUnitTest {
|
||||
|
||||
@Test
|
||||
public void whenMainMethodIsRun_thenStackOverflowError() {
|
||||
Assertions.assertThrows(StackOverflowError.class,
|
||||
() -> ErrorExample.main(null));
|
||||
Assertions.assertThrows(AssertionError.class,
|
||||
() -> ErrorExample.main(null));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user