From 7f117f467f1ebbdd60441942358df13e19de3379 Mon Sep 17 00:00:00 2001 From: Friedrich Volz Date: Fri, 23 Feb 2024 16:23:24 +0100 Subject: [PATCH] fix serializer test, add thumbnail to AASFull --- .../dataformat/aasx/serialization/AASXSerializerTest.java | 4 +++- .../digitaltwin/aas4j/v3/dataformat/core/AASFull.java | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java index 44328137f..f2dcdf458 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java @@ -48,9 +48,11 @@ public class AASXSerializerTest { public void setup() throws IOException { byte[] operationManualContent = { 0, 1, 2, 3, 4 }; byte[] thumbnail = { 0, 1, 2, 3, 4 }; - InMemoryFile file = new InMemoryFile(operationManualContent, "file:///aasx/OperatingManual.pdf"); + InMemoryFile file = new InMemoryFile(operationManualContent, "file:///TestFile.pdf"); + InMemoryFile file2 = new InMemoryFile(operationManualContent, "file:///TestFile2.pdf"); InMemoryFile inMemoryFileThumbnail = new InMemoryFile(thumbnail, "file:///master/verwaltungsschale-detail-part1.png"); fileList.add(file); + fileList.add(file2); fileList.add(inMemoryFileThumbnail); } diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java index b0cd0ae96..04b2f5e88 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/AASFull.java @@ -87,6 +87,8 @@ public class AASFull { public final static ConceptDescription CONCEPT_DESCRIPTION_4 = createConceptDescription4(); public static final Environment ENVIRONMENT = createEnvironment(); public static final String AAS_3_0_RC_02_DATA_SPECIFICATION_IEC_61360 = "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360"; + private static final String FILE_MASTER_VERWALTUNGSSCHALE_DETAIL_PART1_PNG = "file:///master/verwaltungsschale-detail-part1.png"; + private static final String IMAGE_PNG = "image/png"; public static AssetAdministrationShell createAAS1() { return new DefaultAssetAdministrationShell.Builder() @@ -116,6 +118,10 @@ public static AssetAdministrationShell createAAS1() { // .value("http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial") // .build())) // .build()) + .defaultThumbnail(new DefaultResource.Builder() + .contentType(IMAGE_PNG) + .path(FILE_MASTER_VERWALTUNGSSCHALE_DETAIL_PART1_PNG) + .build()) .build()) .submodels(new DefaultReference.Builder() .keys(new DefaultKey.Builder() @@ -1326,7 +1332,7 @@ public static Submodel createSubmodel6() { .build()) .type(ReferenceTypes.EXTERNAL_REFERENCE) .build()) - .value("file:///TestFile.pdf") + .value("file:///TestFile2.pdf") .contentType("application/pdf") .build()) .value(new DefaultReferenceElement.Builder()