Skip to content
Permalink
Browse files
Fix broken tests.
  • Loading branch information
garydgregory committed May 5, 2022
1 parent fcc023a commit 271f3155f58fcd9f3b8a83930aacce57ad806520
Showing 1 changed file with 6 additions and 4 deletions.
@@ -19,22 +19,24 @@

package org.apache.commons.compress.archivers;

import static org.junit.Assert.assertThrows;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;

import org.apache.commons.compress.archivers.TestArchiveStreamProvider.ArchiveInvocationConfirmationException;
import org.junit.jupiter.api.Test;

public class ArchiveServiceLoaderTest {

@Test
public void testInputStream() throws ArchiveException {
ArchiveStreamFactory.DEFAULT.createArchiveInputStream("ArchiveTestInput1", new ByteArrayInputStream(new byte[] {}));
public void testInputStream() {
assertThrows(ArchiveException.class,
() -> ArchiveStreamFactory.DEFAULT.createArchiveInputStream("ArchiveTestInput1", new ByteArrayInputStream(new byte[] {})));
}

@Test
public void testOutputStream() throws ArchiveException {
ArchiveStreamFactory.DEFAULT.createArchiveOutputStream("ArchiveTestOutput1", new ByteArrayOutputStream());
assertThrows(ArchiveException.class, () -> ArchiveStreamFactory.DEFAULT.createArchiveOutputStream("ArchiveTestOutput1", new ByteArrayOutputStream()));
}

}

0 comments on commit 271f315

Please sign in to comment.