From 9b97233af7e8e2687c9f372fe3b481d555534f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Brychta?= Date: Tue, 1 Oct 2024 17:33:18 +0100 Subject: [PATCH] Fix failing unarchiver test --- .../storage_service/bag_unpacker/storage/Unarchiver.scala | 4 ++-- .../bag_unpacker/fixtures/CompressFixture.scala | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bag_unpacker/src/main/scala/weco/storage_service/bag_unpacker/storage/Unarchiver.scala b/bag_unpacker/src/main/scala/weco/storage_service/bag_unpacker/storage/Unarchiver.scala index 27d0080876..ec9899d1db 100644 --- a/bag_unpacker/src/main/scala/weco/storage_service/bag_unpacker/storage/Unarchiver.scala +++ b/bag_unpacker/src/main/scala/weco/storage_service/bag_unpacker/storage/Unarchiver.scala @@ -51,7 +51,7 @@ object Unarchiver { } yield iterator private def createIterator( - archiveInputStream: ArchiveInputStream + archiveInputStream: ArchiveInputStream[ArchiveEntry] ): Iterator[(ArchiveEntry, InputStream)] = new Iterator[(ArchiveEntry, InputStream)] { private var latest: ArchiveEntry = _ @@ -92,7 +92,7 @@ object Unarchiver { private def extract( inputStream: InputStream - ): Either[UnarchiverError, ArchiveInputStream] = + ): Either[UnarchiverError, ArchiveInputStream[ArchiveEntry]] = Try { // We have to wrap in a BufferedInputStream because this method // only takes InputStreams that support the `mark()` method. diff --git a/bag_unpacker/src/test/scala/weco/storage_service/bag_unpacker/fixtures/CompressFixture.scala b/bag_unpacker/src/test/scala/weco/storage_service/bag_unpacker/fixtures/CompressFixture.scala index fe83e74ae3..9060d6ba16 100644 --- a/bag_unpacker/src/test/scala/weco/storage_service/bag_unpacker/fixtures/CompressFixture.scala +++ b/bag_unpacker/src/test/scala/weco/storage_service/bag_unpacker/fixtures/CompressFixture.scala @@ -182,7 +182,7 @@ trait CompressFixture[BagLocation <: Location, Namespace] compressorName: String )( outputStream: OutputStream - ): CompressorOutputStream = { + ): CompressorOutputStream[BufferedOutputStream] = { val compressorStreamFactory = new CompressorStreamFactory() @@ -195,13 +195,13 @@ trait CompressFixture[BagLocation <: Location, Namespace] compressorName, bufferedOutputStream ) - } + }.asInstanceOf[CompressorOutputStream[BufferedOutputStream]] private def packer( archiverName: String )( outputStream: OutputStream - ): ArchiveOutputStream = { + ): ArchiveOutputStream[ArchiveEntry] = { val archiveStreamFactory = new ArchiveStreamFactory()