1313import java .util .List ;
1414
1515import net .lingala .zip4j .ZipFile ;
16+ import net .lingala .zip4j .exception .ZipException ;
1617import net .lingala .zip4j .io .inputstream .ZipInputStream ;
1718import org .junit .AfterClass ;
1819import org .junit .Assert ;
@@ -63,7 +64,7 @@ public void testLoadResources_ZipInputStream() throws IOException {
6364 * Loads the Resources from a zero length file, using ZipInputStream<br/>
6465 * See <a href="https://github.com/psiegman/epublib/issues/122">Issue #122 Infinite loop</a>.
6566 */
66- @ Test (expected = IOException .class )
67+ @ Test (expected = ZipException .class )
6768 public void testLoadResources_ZipInputStream_WithZeroLengthFile ()
6869 throws IOException {
6970 // given
@@ -78,7 +79,7 @@ public void testLoadResources_ZipInputStream_WithZeroLengthFile()
7879 * Loads the Resources from a file that is not a valid zip, using ZipInputStream<br/>
7980 * See <a href="https://github.com/psiegman/epublib/issues/122">Issue #122 Infinite loop</a>.
8081 */
81- @ Test ( expected = IOException . class )
82+ @ Test
8283 public void testLoadResources_ZipInputStream_WithInvalidFile ()
8384 throws IOException {
8485 // given
@@ -87,7 +88,9 @@ public void testLoadResources_ZipInputStream_WithInvalidFile()
8788
8889 // when
8990 Resources resources = ResourcesLoader .loadResources (zipInputStream , encoding );
90- resources .getAll ().forEach (System .out ::println );
91+
92+ // then
93+ Assert .assertEquals (0 , resources .getAll ().size ());
9194 }
9295
9396 /**
@@ -146,7 +149,7 @@ public void testLoadResources_ZipFile_partial_lazy() throws IOException {
146149 Assert
147150 .assertEquals (Resource .class , resources .getById ("chapter1" ).getClass ());
148151 }
149-
152+
150153 private void verifyResources (Resources resources ) throws IOException {
151154 Assert .assertNotNull (resources );
152155 Assert .assertEquals (12 , resources .getAll ().size ());
0 commit comments