Skip to content

Commit c0e4bf3

Browse files
committed
Add test
1 parent 50755b7 commit c0e4bf3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

caching/src/test/java/com/iluwatar/caching/AppTest.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import java.io.IOException;
2929

3030
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
31+
import static org.junit.jupiter.api.Assertions.assertThrows;
3132

3233
/**
3334
* Tests that Caching example runs without errors.
@@ -43,7 +44,14 @@ class AppTest {
4344

4445
@Test
4546
void shouldExecuteApplicationWithoutException() {
46-
4747
assertDoesNotThrow(() -> App.main(new String[]{}));
4848
}
49+
50+
@Test
51+
void executeAppWithException(){
52+
assertThrows(
53+
NoClassDefFoundError.class,
54+
() -> App.main(new String[]{"--mongo"})
55+
);
56+
}
4957
}

0 commit comments

Comments
 (0)