|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
- * Copyright 2020-2024 Steinar Bang
|
|
|
+ * Copyright 2020-2025 Steinar Bang
|
|
|
*
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
* you may not use this file except in compliance with the License.
|
|
@@ -51,6 +51,8 @@ import java.util.Map;
|
|
|
import java.util.Properties;
|
|
|
import java.util.zip.ZipEntry;
|
|
|
import java.util.zip.ZipInputStream;
|
|
|
+import java.util.zip.ZipOutputStream;
|
|
|
+
|
|
|
import javax.imageio.metadata.IIOMetadataNode;
|
|
|
import javax.sql.DataSource;
|
|
|
|
|
@@ -1371,6 +1373,17 @@ class OldAlbumServiceProviderTest {
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
+ void testWriteImageWithModifiedMetadataToZipArchiveWithNullLastModifiedDate() throws Exception {
|
|
|
+ var provider = spy(new OldAlbumServiceProvider());
|
|
|
+ doNothing().when(provider).writeImageWithModifiedMetadataToOutputStream(any(), any(), any(), any()); // Mock to avoid different NPE
|
|
|
+ var zipArchive = mock(ZipOutputStream.class);
|
|
|
+ var imageAndWriter = mock(ImageAndWriter.class);
|
|
|
+ var imageEntryWithNullLastModifiedDate = AlbumEntry.with().imageUrl("").build();
|
|
|
+
|
|
|
+ assertDoesNotThrow(() -> provider.writeImageWithModifiedMetadataToZipArchive(zipArchive, imageEntryWithNullLastModifiedDate, imageAndWriter));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
void testDownloadAlbumEntryOnImageThatIsATextFile() throws Exception {
|
|
|
var replacementTitle = "Replacement title";
|
|
|
var replacementDescription = "Replacement description";
|