From 897fc713e1862870684a38340d93a0b020e25e6f Mon Sep 17 00:00:00 2001 From: Luthien-in-edhil Date: Tue, 24 Sep 2024 13:45:01 +0200 Subject: [PATCH 1/4] awaiting the working unit test --- .../europeana/iiif/service/EdmManifestMappingV2.java | 4 +++- .../europeana/iiif/service/EdmManifestMappingV3.java | 4 +++- .../eu/europeana/iiif/service/EdmManifestData.java | 10 +++++++++- .../iiif/service/EdmManifestV2MappingTest.java | 9 +++++++++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/europeana/iiif/service/EdmManifestMappingV2.java b/src/main/java/eu/europeana/iiif/service/EdmManifestMappingV2.java index 9ba3073..bdd610a 100644 --- a/src/main/java/eu/europeana/iiif/service/EdmManifestMappingV2.java +++ b/src/main/java/eu/europeana/iiif/service/EdmManifestMappingV2.java @@ -10,6 +10,8 @@ import eu.europeana.iiif.model.WebResource; import eu.europeana.iiif.model.v2.*; import eu.europeana.iiif.model.v3.LanguageMap; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -349,7 +351,7 @@ private static eu.europeana.iiif.model.v2.Canvas getCanvasV2(ManifestSettings se //EA-3325: check if the webResource has a "svcsHasService"; if not, add a thumbnail if (Objects.isNull(webResource.get(EdmManifestUtils.SVCS_HAS_SERVICE))){ - c.setThumbnail(getCanvasThumbnailImageV2(webResource.getId())); + c.setThumbnail(getCanvasThumbnailImageV2(URLEncoder.encode(webResource.getId(), StandardCharsets.UTF_8))); } LinkedHashMap> license = (LinkedHashMap>) webResource.get(EdmManifestUtils.WEB_RESOURCE_EDM_RIGHTS); diff --git a/src/main/java/eu/europeana/iiif/service/EdmManifestMappingV3.java b/src/main/java/eu/europeana/iiif/service/EdmManifestMappingV3.java index cde0d84..eb47a82 100644 --- a/src/main/java/eu/europeana/iiif/service/EdmManifestMappingV3.java +++ b/src/main/java/eu/europeana/iiif/service/EdmManifestMappingV3.java @@ -11,6 +11,8 @@ import eu.europeana.iiif.model.WebResourceSorter; import eu.europeana.iiif.model.v3.Collection; import eu.europeana.iiif.model.v3.*; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.commons.lang3.StringUtils; @@ -478,7 +480,7 @@ private static eu.europeana.iiif.model.v3.Canvas getCanvasV3(ManifestSettings se //EA-3325: check if the webResource has a "svcsHasService"; if not, add a thumbnail if (Objects.isNull(webResource.get(EdmManifestUtils.SVCS_HAS_SERVICE))){ - c.setThumbnail(getCanvasThumbnailImageV3(webResource.getId())); + c.setThumbnail(getCanvasThumbnailImageV3(URLEncoder.encode(webResource.getId(), StandardCharsets.UTF_8))); } // a canvas has 1 annotation page by default (an extra annotation page is added later if there is a full text available) diff --git a/src/test/java/eu/europeana/iiif/service/EdmManifestData.java b/src/test/java/eu/europeana/iiif/service/EdmManifestData.java index 759bba9..e387fa2 100644 --- a/src/test/java/eu/europeana/iiif/service/EdmManifestData.java +++ b/src/test/java/eu/europeana/iiif/service/EdmManifestData.java @@ -32,6 +32,8 @@ public class EdmManifestData { public static final String TEST_THUMBNAIL_ID = "https://www.europeana.eu/api/v2/thumbnail-by-url.json?uri=test&size=LARGE&type=IMAGE"; public static final String TEST_THUMBNAIL = "{\"object\": {\"europeanaAggregation\" :{ \"edmPreview\":\""+TEST_THUMBNAIL_ID+"\"}}}"; + + public static final String TEST_CANVAS_THUMBNAIL_ID = "https://www.museumap.hu/media-provider-webapp/rest/file/preview/solr/oai-aggregated-bib9568907?mediaId=323995&size=masterview&tenant_id=Museumap&defaultImage=true"; public static final String TEST_NAVDATE = "{\"object\": {\"proxies\":[{}, {\"dctermsIssued\":{\"en\":[\"NOT A REAL DATE\"]}}, {\"dctermsIssued\":{\"def\":[\"1922-03-15\"]}} ]}}"; @@ -54,7 +56,9 @@ public class EdmManifestData { public static final String TEST_SEQUENCE_3CANVAS_1SERVICE = "{\"object\": { \"proxies\":[{\"about\":\"/proxy/provider/testing\",\"proxyIn\":[\"/aggregation/provider/testing\"]}]," + "\"aggregations\": [ {\"about\":\"/aggregation/provider/testing\",\"edmIsShownBy\": \"wr3Id\", \"hasView\": [\"wr2Id\"], \"webResources\": [ "+ - "{\"about\": \"wr1Id\", \"textAttributionSnippet\": \"wr1Attribution\" , \"webResourceEdmRights\":"+ +// "{\"about\": \"wr1Id\", " + + "{\"about\": \"" + TEST_CANVAS_THUMBNAIL_ID + "\", " + + "\"textAttributionSnippet\": \"wr1Attribution\" , \"webResourceEdmRights\":"+ "{\"def\":[\"wr1License\"]}, \"ebucoreHasMimeType\": \"image/jpeg\" },"+ "{\"about\": \"wr2Id\", \"textAttributionSnippet\": \"wr2Attribution\", \"htmlAttributionSnippet\": \"wr2Attribution\", \"webResourceEdmRights\":"+ "{\"def\":[\"wr2License\"]}, \"ebucoreHasMimeType\": \"audio/mp4\" },"+ @@ -94,5 +98,9 @@ public class EdmManifestData { "{\"about\": \"wr2Id\", \"textAttributionSnippet\": \"wr2Attribution\", \"webResourceEdmRights\":"+ "{\"def\":[\"wr2License\"]}, \"ebucoreHasMimeType\": \"image/jpeg\", \"svcsHasService\": [\"service2Id\"] }"+ "] } ], \"services\": [{\"about\": \"service1Id\", \"doapImplements\": [\"serviceProfile\"]}] } }"; + + public static final String CANVAS_THUMBNAIL_ENCODED_URL = "https%3A%2F%2Fwww.museumap.hu%2Fmedia-provider-webapp%2Frest%2Ffile%2Fpreview%2Fsolr%2Foai-aggregated-bib9568907%3FmediaId%3D323992%26size%3Dmasterview%26tenant_id%3DMuseumap%26defaultImage%3Dtrue"; + + public static final String CANVAS_THUMBNAIL_DECODED_URL = "https://www.museumap.hu/media-provider-webapp/rest/file/preview/solr/oai-aggregated-bib9568907?mediaId=323992&size=masterview&tenant_id=Museumap&defaultImage=true"; } diff --git a/src/test/java/eu/europeana/iiif/service/EdmManifestV2MappingTest.java b/src/test/java/eu/europeana/iiif/service/EdmManifestV2MappingTest.java index ddaad5f..e8f387a 100644 --- a/src/test/java/eu/europeana/iiif/service/EdmManifestV2MappingTest.java +++ b/src/test/java/eu/europeana/iiif/service/EdmManifestV2MappingTest.java @@ -1,5 +1,8 @@ package eu.europeana.iiif.service; +import static eu.europeana.iiif.service.EdmManifestData.CANVAS_THUMBNAIL_DECODED_URL; +import static eu.europeana.iiif.service.EdmManifestData.CANVAS_THUMBNAIL_ENCODED_URL; + import com.jayway.jsonpath.Configuration; import eu.europeana.iiif.config.AppConfig; import eu.europeana.iiif.config.ManifestSettings; @@ -290,6 +293,7 @@ public void testSequence() { Object document = Configuration.defaultConfiguration().jsonProvider().parse(EdmManifestData.TEST_SEQUENCE_3CANVAS_1SERVICE); String edmIsShownBy = EdmManifestUtils.getValueFromDataProviderAggregation(document, null, "edmIsShownBy"); Sequence[] sequence = EdmManifestMappingV2.getSequencesV2(settings, mediaTypes,"/test-id", edmIsShownBy, document); +// sequence[0].getCanvases()[0].setThumbnail(new eu.europeana.iiif.model.v2.Image(CANVAS_THUMBNAIL_ENCODED_URL, 40, 40)); Assertions.assertNotNull(sequence); Assertions.assertEquals(1, sequence.length); // there should always be only 1 sequence @@ -307,6 +311,7 @@ public void testSequence() { ecv.label = "p. 1"; ecv.attribution = "wr3Attribution"; ecv.license = "wr3License"; + ecv.thumbNail = new eu.europeana.iiif.model.v2.Image(CANVAS_THUMBNAIL_DECODED_URL, 40, 40); ecv.annotationAndBody = new ExpectedAnnotationAndBodyValues(); ecv.annotationAndBody.idEndsWith = "/test-id/annotation/p1"; ecv.annotationAndBody.onId = ecv.id; @@ -329,6 +334,9 @@ public void checkCanvas(ExpectedCanvasValues ecv, Canvas c) { Assertions.assertEquals(ecv.attribution, c.getAttribution()); Assertions.assertEquals(ecv.license, c.getLicense()); + // test thumbnail URL encoding + Assertions.assertEquals(ecv.thumbNail.getId(), c.getThumbnail().getId()); + // test image/annotation part (can be at most 1) if (ecv.annotationAndBody == null) { Assertions.assertNull(c.getAttribution()); @@ -371,6 +379,7 @@ private static class ExpectedCanvasValues { String attribution; String license; ExpectedAnnotationAndBodyValues annotationAndBody; + Image thumbNail; } private static class ExpectedAnnotationAndBodyValues { From 81eb14f2d1eae511e970c8f573855bc28c2f6692 Mon Sep 17 00:00:00 2001 From: Luthien-in-edhil Date: Tue, 24 Sep 2024 16:29:36 +0200 Subject: [PATCH 2/4] added unit test --- .../iiif/service/EdmManifestMappingV2.java | 8 ++--- .../iiif/service/EdmManifestData.java | 17 +++++++--- .../service/EdmManifestV2MappingTest.java | 32 ++++++++++++++++--- .../service/EdmManifestV3MappingTest.java | 31 ++++++++++++++++++ 4 files changed, 75 insertions(+), 13 deletions(-) diff --git a/src/main/java/eu/europeana/iiif/service/EdmManifestMappingV2.java b/src/main/java/eu/europeana/iiif/service/EdmManifestMappingV2.java index bdd610a..9c90bd0 100644 --- a/src/main/java/eu/europeana/iiif/service/EdmManifestMappingV2.java +++ b/src/main/java/eu/europeana/iiif/service/EdmManifestMappingV2.java @@ -204,12 +204,12 @@ static eu.europeana.iiif.model.v2.Image getThumbnailImageV2(String europeanaId, * @param webresourceId hasview image ID * @return Image object, or null if either provided String was null */ - static eu.europeana.iiif.model.v2.Image getCanvasThumbnailImageV2(String webresourceId) { - if (StringUtils.isAnyEmpty(THUMBNAIL_API_URL, webresourceId)) { + static eu.europeana.iiif.model.v2.Image getCanvasThumbnailImageV2(String webresourceId, String ThumbnailApiUrl) { + if (StringUtils.isAnyEmpty(ThumbnailApiUrl, webresourceId)) { return null; } return new eu.europeana.iiif.model.v2.Image( - THUMBNAIL_API_URL + webresourceId + CANVAS_THUMBNAIL_POSTFIX, + ThumbnailApiUrl + webresourceId + CANVAS_THUMBNAIL_POSTFIX, null, null); } @@ -351,7 +351,7 @@ private static eu.europeana.iiif.model.v2.Canvas getCanvasV2(ManifestSettings se //EA-3325: check if the webResource has a "svcsHasService"; if not, add a thumbnail if (Objects.isNull(webResource.get(EdmManifestUtils.SVCS_HAS_SERVICE))){ - c.setThumbnail(getCanvasThumbnailImageV2(URLEncoder.encode(webResource.getId(), StandardCharsets.UTF_8))); + c.setThumbnail(getCanvasThumbnailImageV2(URLEncoder.encode(webResource.getId(), StandardCharsets.UTF_8), settings.getThumbnailApiUrl())); } LinkedHashMap> license = (LinkedHashMap>) webResource.get(EdmManifestUtils.WEB_RESOURCE_EDM_RIGHTS); diff --git a/src/test/java/eu/europeana/iiif/service/EdmManifestData.java b/src/test/java/eu/europeana/iiif/service/EdmManifestData.java index e387fa2..b56dfd9 100644 --- a/src/test/java/eu/europeana/iiif/service/EdmManifestData.java +++ b/src/test/java/eu/europeana/iiif/service/EdmManifestData.java @@ -56,9 +56,7 @@ public class EdmManifestData { public static final String TEST_SEQUENCE_3CANVAS_1SERVICE = "{\"object\": { \"proxies\":[{\"about\":\"/proxy/provider/testing\",\"proxyIn\":[\"/aggregation/provider/testing\"]}]," + "\"aggregations\": [ {\"about\":\"/aggregation/provider/testing\",\"edmIsShownBy\": \"wr3Id\", \"hasView\": [\"wr2Id\"], \"webResources\": [ "+ -// "{\"about\": \"wr1Id\", " + - "{\"about\": \"" + TEST_CANVAS_THUMBNAIL_ID + "\", " + - "\"textAttributionSnippet\": \"wr1Attribution\" , \"webResourceEdmRights\":"+ + "{\"about\": \"wr1Id\", \"textAttributionSnippet\": \"wr1Attribution\" , \"webResourceEdmRights\":"+ "{\"def\":[\"wr1License\"]}, \"ebucoreHasMimeType\": \"image/jpeg\" },"+ "{\"about\": \"wr2Id\", \"textAttributionSnippet\": \"wr2Attribution\", \"htmlAttributionSnippet\": \"wr2Attribution\", \"webResourceEdmRights\":"+ "{\"def\":[\"wr2License\"]}, \"ebucoreHasMimeType\": \"audio/mp4\" },"+ @@ -66,6 +64,17 @@ public class EdmManifestData { "{\"def\":[\"wr3License\"]}, \"ebucoreHasMimeType\": \"image/webp\", \"svcsHasService\": [\"service3Id\"], \"ebucoreDuration\": \"98765\" }"+ "] } ], \"services\": [{\"about\": \"service3Id\", \"doapImplements\": [\"serviceProfile\"]}] } }"; + public static final String TEST_SEQUENCE_1CANVAS_THUMB = "{\"object\": { \"proxies\":[{\"about\":\"/proxy/provider/testing\",\"proxyIn\":[\"/aggregation/provider/testing\"]}]," + + "\"aggregations\": [ {\"about\":\"/aggregation/provider/testing\",\"edmIsShownBy\": \"wr2Id\", " + + "\"hasView\": [\"" + TEST_CANVAS_THUMBNAIL_ID + "\"], " + + "\"webResources\": [ "+ + "{\"about\": \"" + TEST_CANVAS_THUMBNAIL_ID + "\", " + + "\"textAttributionSnippet\": \"wr1Attribution\" , \"webResourceEdmRights\":"+ + "{\"def\":[\"wr1License\"]}, \"ebucoreHasMimeType\": \"image/jpeg\" },"+ + "{\"about\": \"wr2Id\", \"textAttributionSnippet\": \"wr2Attribution\", \"htmlAttributionSnippet\": \"wr2Attribution\", \"webResourceEdmRights\":"+ + "{\"def\":[\"wr2License\"]}, \"ebucoreHasMimeType\": \"image/webp\", \"svcsHasService\": [\"service2Id\"], \"ebucoreDuration\": \"98765\" }"+ + "] } ], \"services\": [{\"about\": \"service2Id\", \"doapImplements\": [\"serviceProfile\"]}] } }"; + public static final String TEST_SEQUENCE_MULTIPLE_PROXY_AGG = "{ \"object\" : { \"aggregations\": [" + "{\"about\": \"/aggregation/provider/1/\", \"edmIsShownBy\": \"provider_edmIsShownBy\", \"hasView\": [\"wr2Id\"]," + @@ -99,7 +108,7 @@ public class EdmManifestData { "{\"def\":[\"wr2License\"]}, \"ebucoreHasMimeType\": \"image/jpeg\", \"svcsHasService\": [\"service2Id\"] }"+ "] } ], \"services\": [{\"about\": \"service1Id\", \"doapImplements\": [\"serviceProfile\"]}] } }"; - public static final String CANVAS_THUMBNAIL_ENCODED_URL = "https%3A%2F%2Fwww.museumap.hu%2Fmedia-provider-webapp%2Frest%2Ffile%2Fpreview%2Fsolr%2Foai-aggregated-bib9568907%3FmediaId%3D323992%26size%3Dmasterview%26tenant_id%3DMuseumap%26defaultImage%3Dtrue"; + public static final String CANVAS_THUMBNAIL_ENCODED_URL = "https%3A%2F%2Fwww.museumap.hu%2Fmedia-provider-webapp%2Frest%2Ffile%2Fpreview%2Fsolr%2Foai-aggregated-bib9568907%3FmediaId%3D323995%26size%3Dmasterview%26tenant_id%3DMuseumap%26defaultImage%3Dtrue"; public static final String CANVAS_THUMBNAIL_DECODED_URL = "https://www.museumap.hu/media-provider-webapp/rest/file/preview/solr/oai-aggregated-bib9568907?mediaId=323992&size=masterview&tenant_id=Museumap&defaultImage=true"; } diff --git a/src/test/java/eu/europeana/iiif/service/EdmManifestV2MappingTest.java b/src/test/java/eu/europeana/iiif/service/EdmManifestV2MappingTest.java index e8f387a..94db488 100644 --- a/src/test/java/eu/europeana/iiif/service/EdmManifestV2MappingTest.java +++ b/src/test/java/eu/europeana/iiif/service/EdmManifestV2MappingTest.java @@ -1,5 +1,6 @@ package eu.europeana.iiif.service; +import static eu.europeana.iiif.model.ManifestDefinitions.CANVAS_THUMBNAIL_POSTFIX; import static eu.europeana.iiif.service.EdmManifestData.CANVAS_THUMBNAIL_DECODED_URL; import static eu.europeana.iiif.service.EdmManifestData.CANVAS_THUMBNAIL_ENCODED_URL; @@ -293,7 +294,6 @@ public void testSequence() { Object document = Configuration.defaultConfiguration().jsonProvider().parse(EdmManifestData.TEST_SEQUENCE_3CANVAS_1SERVICE); String edmIsShownBy = EdmManifestUtils.getValueFromDataProviderAggregation(document, null, "edmIsShownBy"); Sequence[] sequence = EdmManifestMappingV2.getSequencesV2(settings, mediaTypes,"/test-id", edmIsShownBy, document); -// sequence[0].getCanvases()[0].setThumbnail(new eu.europeana.iiif.model.v2.Image(CANVAS_THUMBNAIL_ENCODED_URL, 40, 40)); Assertions.assertNotNull(sequence); Assertions.assertEquals(1, sequence.length); // there should always be only 1 sequence @@ -311,7 +311,6 @@ public void testSequence() { ecv.label = "p. 1"; ecv.attribution = "wr3Attribution"; ecv.license = "wr3License"; - ecv.thumbNail = new eu.europeana.iiif.model.v2.Image(CANVAS_THUMBNAIL_DECODED_URL, 40, 40); ecv.annotationAndBody = new ExpectedAnnotationAndBodyValues(); ecv.annotationAndBody.idEndsWith = "/test-id/annotation/p1"; ecv.annotationAndBody.onId = ecv.id; @@ -334,9 +333,6 @@ public void checkCanvas(ExpectedCanvasValues ecv, Canvas c) { Assertions.assertEquals(ecv.attribution, c.getAttribution()); Assertions.assertEquals(ecv.license, c.getLicense()); - // test thumbnail URL encoding - Assertions.assertEquals(ecv.thumbNail.getId(), c.getThumbnail().getId()); - // test image/annotation part (can be at most 1) if (ecv.annotationAndBody == null) { Assertions.assertNull(c.getAttribution()); @@ -347,6 +343,32 @@ public void checkCanvas(ExpectedCanvasValues ecv, Canvas c) { } } + /** + * Test if canvas thumbnails are URLencoded properly + */ + @Test + public void testCanvasWithThumbnail() { + Object document = Configuration.defaultConfiguration().jsonProvider().parse(EdmManifestData.TEST_SEQUENCE_1CANVAS_THUMB); + String edmIsShownBy = EdmManifestUtils.getValueFromDataProviderAggregation(document, null, "edmIsShownBy"); + Sequence[] sequence = EdmManifestMappingV2.getSequencesV2(settings, mediaTypes,"/test-id", edmIsShownBy, document); + Assertions.assertNotNull(sequence); + Assertions.assertEquals(1, sequence.length); // one sequence + + // test canvas part + Assertions.assertTrue(sequence[0].getStartCanvas().endsWith("/test-id" + "/canvas/p1")); + Assertions.assertNotNull(sequence[0].getCanvases()); + Assertions.assertEquals(2, sequence[0].getCanvases().length); // with two canvasii + + // only the second canvas contains the canvas thumbnail and needs checking + ExpectedCanvasValues ecv = new ExpectedCanvasValues(); + ecv.id = sequence[0].getCanvases()[1].getId(); + String ThumbnailUrl = settings.getThumbnailApiUrl() + CANVAS_THUMBNAIL_ENCODED_URL + CANVAS_THUMBNAIL_POSTFIX; + ecv.thumbNail = new eu.europeana.iiif.model.v2.Image(ThumbnailUrl, null, null); + + Assertions.assertEquals(ecv.thumbNail.getId(), sequence[0].getCanvases()[1].getThumbnail().getId()); + } + + /** * Test if we generate an annotation and annotation body object (and containing service object) properly */ diff --git a/src/test/java/eu/europeana/iiif/service/EdmManifestV3MappingTest.java b/src/test/java/eu/europeana/iiif/service/EdmManifestV3MappingTest.java index e882eb4..bafe249 100644 --- a/src/test/java/eu/europeana/iiif/service/EdmManifestV3MappingTest.java +++ b/src/test/java/eu/europeana/iiif/service/EdmManifestV3MappingTest.java @@ -1,12 +1,15 @@ package eu.europeana.iiif.service; import static eu.europeana.iiif.model.ManifestDefinitions.ATTRIBUTION_STRING; +import static eu.europeana.iiif.model.ManifestDefinitions.CANVAS_THUMBNAIL_POSTFIX; +import static eu.europeana.iiif.service.EdmManifestData.CANVAS_THUMBNAIL_ENCODED_URL; import com.jayway.jsonpath.Configuration; import eu.europeana.iiif.config.AppConfig; import eu.europeana.iiif.config.ManifestSettings; import eu.europeana.iiif.config.MediaTypes; import eu.europeana.iiif.config.SerializationConfig; +import eu.europeana.iiif.model.v2.Sequence; import eu.europeana.iiif.model.v3.*; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -457,6 +460,33 @@ private void checkCanvas(ExpectedCanvasAndAnnotationPageValues expected, Canvas } } + /** + * Test if canvas thumbnails are URLencoded properly + */ + @Test + public void testCanvasWithThumbnail() { + Object document = Configuration.defaultConfiguration().jsonProvider().parse(EdmManifestData.TEST_SEQUENCE_1CANVAS_THUMB); + String edmIsShownBy = EdmManifestUtils.getValueFromDataProviderAggregation(document, null, "edmIsShownBy"); + Sequence[] sequence = EdmManifestMappingV2.getSequencesV2(settings, mediaTypes, "/test-id", edmIsShownBy, document); + Assertions.assertNotNull(sequence); + Assertions.assertEquals(1, sequence.length); // one sequence + + // test canvas part + Assertions.assertTrue(sequence[0].getStartCanvas().endsWith("/test-id" + "/canvas/p1")); + Assertions.assertNotNull(sequence[0].getCanvases()); + Assertions.assertEquals(2, sequence[0].getCanvases().length); // with two canvasii + + // only the second canvas contains the canvas thumbnail and needs checking + String thumbnailUrl = settings.getThumbnailApiUrl() + CANVAS_THUMBNAIL_ENCODED_URL + CANVAS_THUMBNAIL_POSTFIX; + ExpectedCanvasAndAnnotationPageValues ecapv = new ExpectedCanvasAndAnnotationPageValues(); + eu.europeana.iiif.model.v3.Image[] Thumbnails = { + new eu.europeana.iiif.model.v3.Image(thumbnailUrl) + }; + ecapv.thumbnails = Thumbnails; + + Assertions.assertEquals(ecapv.thumbnails[0].getId(), sequence[0].getCanvases()[1].getThumbnail().getId()); + } + private void checkAnnotationAndBodyAndServiceValues(ExpectedAnnotationAndBodyValues[] expectedAnnotations, Annotation[] annotations) { Assertions.assertNotNull(annotations); Assertions.assertNotNull(expectedAnnotations); @@ -497,6 +527,7 @@ private static class ExpectedCanvasAndAnnotationPageValues { // in these tests there can be only 1 annotationPage (because full-text availability check is done elsewhere) String annoPageid; String annoPageType; + Image[] thumbnails; ExpectedAnnotationAndBodyValues[] annoPageAnnotationAndBody; } From 384d98747e388331a5661c3f4bdbbb407f4a9b86 Mon Sep 17 00:00:00 2001 From: Luthien-in-edhil Date: Tue, 24 Sep 2024 16:39:13 +0200 Subject: [PATCH 3/4] updated Fulltext dependency version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e048bed..bf2fb16 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ ${java.version} europeana - 0.9.1 + 0.9.7 0.3.20 2.7.11 From ef1e52e26921837fc34ae277a1c9c20adc0b6caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=BAthien?= Date: Wed, 25 Sep 2024 13:49:11 +0200 Subject: [PATCH 4/4] trying to get the dependency checker working again --- .gitignore | 1 + owasp-suppress.xml | 29 ++++++++++++++++++++++++++++- pom.xml | 36 +++++++++++++++++++++--------------- 3 files changed, 50 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index f521125..692dd78 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ nbdist/ ### JEnv ### .java-version +/pom-local-depcheck.xml diff --git a/owasp-suppress.xml b/owasp-suppress.xml index 8da4074..8ac17b3 100644 --- a/owasp-suppress.xml +++ b/owasp-suppress.xml @@ -22,5 +22,32 @@ ^pkg:maven/org\.apache\.tomcat\.embed/tomcat\-embed\-core@.*$ CVE-2022-45143 - + + + ^pkg:maven/org\.springframework/spring-web@.*$ + CVE-2024-22262 + + + + ^pkg:maven/org\.springframework/spring-web@.*$ + CVE-2024-22243 + + + + ^pkg:maven/org\.springframework/spring-web@.*$ + CVE-2024-38809 + + + + ^pkg:javascript/DOMPurify@.*$ + CVE-2024-45801 + \ No newline at end of file diff --git a/pom.xml b/pom.xml index bf2fb16..8e52e1c 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ 0.3.20 2.7.11 - 1.6.13 + 1.8.0 2.14.1 2.9.0 2.4.0-b180830.0359 @@ -40,6 +40,11 @@ 3.7.0 2.35.1 + 10.0.4 + 2.22.2 + 6.3.3 + 6.3.3 + @@ -144,12 +149,13 @@ org.springframework.security spring-security-core - 5.7.8 + ${spring-security.version} + org.springframework.security spring-security-crypto - 5.7.8 + ${spring-security-crypto.version} @@ -230,7 +236,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.22.2 + ${maven-surefire-plugin.version} org.springframework.boot @@ -244,18 +250,18 @@ - - - - - - depcheck - - + + + + + + + + org.owasp dependency-check-maven - 9.2.0 + ${dependency-check-maven.version} NVD_APIKEY @@ -276,7 +282,7 @@ - - + +