Skip to content

Commit

Permalink
fix:DO-4418:rename all properties to catenaXSiteId
Browse files Browse the repository at this point in the history
- Review Feedback
- drop unused code
  • Loading branch information
hgo-ds committed Nov 28, 2023
1 parent 184c47e commit 44070fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -81,14 +82,10 @@ List<AssetBase> readAndConvertAssetsAsPlannedForTests() {
return readAndConvertAssetsAsPlannedForTests("/data/irs_assets_as_planned_v4.json");
}

@SneakyThrows(IOException.class)
List<AssetBase> 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();
}
}

0 comments on commit 44070fe

Please sign in to comment.