From 188a7d2318d217198655df9f04cbffafaad5257d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Heinrich=20G=C3=B6tzger=20EXT?= Date: Tue, 28 Nov 2023 16:51:30 +0100 Subject: [PATCH] fix:DO-4418:rename all properties to catenaXSiteId - Review Feedback - drop unused code --- .../irs/model/response/semanticdatamodel/Site.java | 2 +- .../integration/common/support/AssetTestData.java | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/semanticdatamodel/Site.java b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/semanticdatamodel/Site.java index aea6967e3b..df14ed86f2 100644 --- a/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/semanticdatamodel/Site.java +++ b/tx-backend/src/main/java/org/eclipse/tractusx/traceability/assets/infrastructure/base/irs/model/response/semanticdatamodel/Site.java @@ -32,7 +32,7 @@ public record Site( @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'hh:mm:ss", timezone = "UTC") OffsetDateTime functionValidFrom, String function, // As long as no clear spelling is defined, be lax with it. https://github.com/eclipse-tractusx/sldt-semantic-models/issues/470 - @JsonFormat(with = JsonFormat.Feature.ACCEPT_CASE_INSENSITIVE_PROPERTIES) + // JsonFormat.Feature.ACCEPT_CASE_INSENSITIVE_PROPERTIES is not working, as it is a global feature. @JsonAlias({ "catenaXSiteId", "catenaxSiteId", "catenaXsiteId", "catenaxsiteId", "catenaXSiteid", "catenaxSiteid", "catenaXsiteid", "catenaxsiteid"}) diff --git a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AssetTestData.java b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AssetTestData.java index 8986b57f95..0aff960b07 100644 --- a/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AssetTestData.java +++ b/tx-backend/src/test/java/org/eclipse/tractusx/traceability/integration/common/support/AssetTestData.java @@ -23,6 +23,7 @@ import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import lombok.SneakyThrows; import org.eclipse.tractusx.traceability.assets.domain.base.model.AssetBase; import org.eclipse.tractusx.traceability.assets.infrastructure.base.irs.model.response.JobDetailResponse; @@ -81,14 +82,10 @@ List readAndConvertAssetsAsPlannedForTests() { return readAndConvertAssetsAsPlannedForTests("/data/irs_assets_as_planned_v4.json"); } + @SneakyThrows(IOException.class) List readAndConvertAssetsAsPlannedForTests(final String resourceName) { - try { - final var file = AssetTestData.class.getResourceAsStream(resourceName); - final var response = mapper.readValue(file, JobDetailResponse.class); - return response.convertAssets(); - } catch (final IOException e) { - e.printStackTrace(); // is allowed in test scope - return Collections.emptyList(); - } + final var file = AssetTestData.class.getResourceAsStream(resourceName); + final var response = mapper.readValue(file, JobDetailResponse.class); + return response.convertAssets(); } }