Added braces to the if block
@@ -6,10 +6,11 @@ public class CheckClassExistenceUnitTest {
public static class InitializingClass {
static {
- if (true) //enable throwing of an exception in a static initialization block
+ if (true) { //enable throwing of an exception in a static initialization block
throw new RuntimeException();
}
}
+ }
@Test(expected = ClassNotFoundException.class) //thrown when class does not exist
public void givenNonExistingClass_whenUsingForName_classNotFound() throws ClassNotFoundException {
