diff --git a/extensions/wrapper/wrapper-common-mappers/src/test/java/de/sovity/edc/ext/wrapper/api/common/mappers/AssetMapperTest.java b/extensions/wrapper/wrapper-common-mappers/src/test/java/de/sovity/edc/ext/wrapper/api/common/mappers/AssetMapperTest.java index 36089903d..7ccde1954 100644 --- a/extensions/wrapper/wrapper-common-mappers/src/test/java/de/sovity/edc/ext/wrapper/api/common/mappers/AssetMapperTest.java +++ b/extensions/wrapper/wrapper-common-mappers/src/test/java/de/sovity/edc/ext/wrapper/api/common/mappers/AssetMapperTest.java @@ -16,6 +16,7 @@ import java.nio.file.Files; import java.nio.file.Paths; +import java.util.Arrays; import java.util.List; import java.util.Map; @@ -72,6 +73,17 @@ void test_buildAssetDto() { assertThat(uiAsset.getDataModel()).isEqualTo("my-data-model-001"); assertThat(uiAsset.getGeoReferenceMethod()).isEqualTo("my-geo-reference-method"); assertThat(uiAsset.getTransportMode()).isEqualTo("my-geo-reference-method"); + assertThat(uiAsset.getSovereignLegalName()).isEqualTo("my-sovereign"); + assertThat(uiAsset.getGeoLocation()).isEqualTo("my-geolocation"); + assertThat(uiAsset.getNutsLocation()).isEqualTo(Arrays.asList("my-nuts-location1", "my-nuts-location2")); + assertThat(uiAsset.getDataSampleUrls()).isEqualTo(Arrays.asList("my-data-sample-urls1", "my-data-sample-urls2")); + assertThat(uiAsset.getReferenceFileUrls()).isEqualTo(Arrays.asList("my-reference-files1", "my-reference-files2")); + assertThat(uiAsset.getReferenceFilesDescription()).isEqualTo("my-additional-description"); + assertThat(uiAsset.getConditionsForUse()).isEqualTo("my-conditions-for-use"); + assertThat(uiAsset.getDataUpdateFrequency()).isEqualTo("my-data-update-frequency"); + assertThat(uiAsset.getTemporalCoverageFrom()).isEqualTo("2007-12-03"); + assertThat(uiAsset.getTemporalCoverageToInclusive()).isEqualTo("2024-01-22"); + assertThat(uiAsset.getAssetJsonLd()).contains("\"%s\"".formatted(Prop.Edc.ID)); assertThat(uiAsset.getAdditionalProperties()).containsExactlyEntriesOf(Map.of( "http://unknown/some-custom-string", "some-string-value")); diff --git a/extensions/wrapper/wrapper/src/test/java/de/sovity/edc/ext/wrapper/api/ui/pages/asset/AssetApiServiceTest.java b/extensions/wrapper/wrapper/src/test/java/de/sovity/edc/ext/wrapper/api/ui/pages/asset/AssetApiServiceTest.java index 7812141c6..b54ed364c 100644 --- a/extensions/wrapper/wrapper/src/test/java/de/sovity/edc/ext/wrapper/api/ui/pages/asset/AssetApiServiceTest.java +++ b/extensions/wrapper/wrapper/src/test/java/de/sovity/edc/ext/wrapper/api/ui/pages/asset/AssetApiServiceTest.java @@ -34,6 +34,8 @@ import org.junit.jupiter.api.extension.ExtendWith; import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.util.Arrays; import java.util.List; import java.util.Map; @@ -117,6 +119,16 @@ void testAssetCreation(AssetService assetService) { .dataModel("dataModel") .geoReferenceMethod("geoReferenceMethod") .transportMode("transportMode") + .sovereignLegalName("my sovereign") + .geoLocation("40.0, 40.0") + .nutsLocation(Arrays.asList("DE", "DE929")) + .dataSampleUrls(Arrays.asList("https://sample-a", "https://sample-b")) + .referenceFileUrls(Arrays.asList("https://reference-a", "https://reference-b")) + .referenceFilesDescription("RF Description") + .conditionsForUse("Conditions for use") + .dataUpdateFrequency("every month") + .temporalCoverageFrom(LocalDate.of(2020, 1, 1)) + .temporalCoverageToInclusive(LocalDate.of(2020, 1, 8)) .keywords(List.of("keyword1", "keyword2")) .publisherHomepage("publisherHomepage") .dataAddressProperties(dataAddressProperties) @@ -142,6 +154,16 @@ void testAssetCreation(AssetService assetService) { assertThat(asset.getDataModel()).isEqualTo("dataModel"); assertThat(asset.getGeoReferenceMethod()).isEqualTo("geoReferenceMethod"); assertThat(asset.getTransportMode()).isEqualTo("transportMode"); + assertThat(asset.getSovereignLegalName()).isEqualTo("my sovereign"); + assertThat(asset.getGeoLocation()).isEqualTo("40.0, 40.0"); + assertThat(asset.getNutsLocation()).isEqualTo(Arrays.asList("DE", "DE929")); + assertThat(asset.getDataSampleUrls()).isEqualTo(Arrays.asList("https://sample-a", "https://sample-b")); + assertThat(asset.getReferenceFileUrls()).isEqualTo(Arrays.asList("https://reference-a", "https://reference-b")); + assertThat(asset.getReferenceFilesDescription()).isEqualTo("RF Description"); + assertThat(asset.getConditionsForUse()).isEqualTo("Conditions for use"); + assertThat(asset.getDataUpdateFrequency()).isEqualTo("every month"); + assertThat(asset.getTemporalCoverageFrom()).isEqualTo(LocalDate.of(2020, 1, 1)); + assertThat(asset.getTemporalCoverageToInclusive()).isEqualTo(LocalDate.of(2020, 1, 8)); assertThat(asset.getLicenseUrl()).isEqualTo("https://license-url"); assertThat(asset.getKeywords()).isEqualTo(List.of("keyword1", "keyword2")); assertThat(asset.getCreatorOrganizationName()).isEqualTo("My Org"); @@ -180,6 +202,16 @@ void testEditAssetMetadata(AssetService assetService) { .dataModel("dataModel") .geoReferenceMethod("geoReferenceMethod") .transportMode("transportMode") + .sovereignLegalName("my sovereign") + .geoLocation("40.0, 40.0") + .nutsLocation(Arrays.asList("DE", "DE929")) + .dataSampleUrls(Arrays.asList("https://sample-a", "https://sample-b")) + .referenceFileUrls(Arrays.asList("https://reference-a", "https://reference-b")) + .referenceFilesDescription("RF Description") + .conditionsForUse("Conditions for use") + .dataUpdateFrequency("every month") + .temporalCoverageFrom(LocalDate.of(2020, 1, 1)) + .temporalCoverageToInclusive(LocalDate.of(2020, 1, 8)) .keywords(List.of("keyword1", "keyword2")) .publisherHomepage("publisherHomepage") .dataAddressProperties(dataAddress) @@ -196,6 +228,16 @@ void testEditAssetMetadata(AssetService assetService) { .dataSubcategory("dataSubcategory2") .dataModel("dataModel2") .geoReferenceMethod("geoReferenceMethod2") + .sovereignLegalName("my sovereign2") + .geoLocation("50.0, 50.0") + .nutsLocation(Arrays.asList("NL", "NL929")) + .dataSampleUrls(Arrays.asList("https://sample-a2", "https://sample-b2")) + .referenceFileUrls(Arrays.asList("https://reference-a2", "https://reference-b2")) + .referenceFilesDescription("RF Description2") + .conditionsForUse("Conditions for use2") + .dataUpdateFrequency("every week") + .temporalCoverageFrom(LocalDate.of(2021, 1, 1)) + .temporalCoverageToInclusive(LocalDate.of(2021, 1, 8)) .transportMode("transportMode2") .keywords(List.of("keyword3")) .publisherHomepage("publisherHomepage2") @@ -221,6 +263,16 @@ void testEditAssetMetadata(AssetService assetService) { assertThat(asset.getDataModel()).isEqualTo("dataModel2"); assertThat(asset.getGeoReferenceMethod()).isEqualTo("geoReferenceMethod2"); assertThat(asset.getTransportMode()).isEqualTo("transportMode2"); + assertThat(asset.getSovereignLegalName()).isEqualTo("my sovereign2"); + assertThat(asset.getGeoLocation()).isEqualTo("50.0, 50.0"); + assertThat(asset.getNutsLocation()).isEqualTo(Arrays.asList("NL", "NL929")); + assertThat(asset.getDataSampleUrls()).isEqualTo(Arrays.asList("https://sample-a2", "https://sample-b2")); + assertThat(asset.getReferenceFileUrls()).isEqualTo(Arrays.asList("https://reference-a2", "https://reference-b2")); + assertThat(asset.getReferenceFilesDescription()).isEqualTo("RF Description2"); + assertThat(asset.getConditionsForUse()).isEqualTo("Conditions for use2"); + assertThat(asset.getDataUpdateFrequency()).isEqualTo("every week"); + assertThat(asset.getTemporalCoverageFrom()).isEqualTo(LocalDate.of(2021, 1, 1)); + assertThat(asset.getTemporalCoverageToInclusive()).isEqualTo(LocalDate.of(2021, 1, 8)); assertThat(asset.getLicenseUrl()).isEqualTo("https://license-url/2"); assertThat(asset.getKeywords()).isEqualTo(List.of("keyword3")); assertThat(asset.getCreatorOrganizationName()).isEqualTo("My Org");