Skip to content

Commit

Permalink
add new fields to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kulgg committed Feb 14, 2024
1 parent 7c23236 commit 9298b91
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
Expand All @@ -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");
Expand Down Expand Up @@ -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)
Expand All @@ -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")
Expand All @@ -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");
Expand Down

0 comments on commit 9298b91

Please sign in to comment.