From 3644cf6f48b3e6afacef83a40527eca743f3fcb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Skaar=2C=20Bj=C3=B8rn-Andre?= Date: Mon, 18 Dec 2023 13:48:09 +0100 Subject: [PATCH] Bump rest-assured version --- klass-api/pom.xml | 2 +- .../RestApiChangesIntegrationTest.java | 4 ++-- ...estApiClassificationFamilyIntegrationTest.java | 4 ++-- .../RestApiClassificationIntegrationTest.java | 4 ++-- .../RestApiCodeAtIntegrationTest.java | 12 ++++++------ .../RestApiCodeIntegrationTest.java | 8 ++++---- ...estApiCorrespondenceTablesIntegrationTest.java | 6 +++--- .../RestApiCorrespondsAtIntegrationTest.java | 8 ++++---- .../RestApiCorrespondsIntegrationTest.java | 8 ++++---- .../RestApiDraftIntegrationTest.java | 4 ++-- .../RestApiErrorHandlingIntegrationTest.java | 4 ++-- ...piListClassificationFamilyIntegrationTest.java | 4 ++-- .../RestApiListClassificationIntegrationTest.java | 4 ++-- .../RestApiListSsbSectionIntegrationTest.java | 4 ++-- .../RestApiSearchIntegrationTest.java | 4 ++-- .../RestApiVariantAtIntegrationTest.java | 12 ++++++------ .../RestApiVariantIntegrationTest.java | 8 ++++---- .../api/dto/hal/ClassificationResourceTest.java | 2 +- klass-shared/pom.xml | 4 ++-- .../java/no/ssb/klass/core/model/Changelog.java | 9 ++++++--- .../ssb/klass/core/model/ClassificationItem.java | 2 ++ .../klass/core/model/ClassificationVariant.java | 3 +++ .../ssb/klass/core/model/CorrespondenceMap.java | 3 +++ .../ssb/klass/core/model/CorrespondenceTable.java | 15 +++++++++------ .../main/java/no/ssb/klass/core/model/User.java | 7 +++++-- ...ferencingClassificationItemRepositoryTest.java | 4 +--- pom.xml | 4 ++-- 27 files changed, 84 insertions(+), 69 deletions(-) diff --git a/klass-api/pom.xml b/klass-api/pom.xml index e51f5aa7..75f57e0f 100644 --- a/klass-api/pom.xml +++ b/klass-api/pom.xml @@ -142,7 +142,7 @@ test - com.jayway.restassured + io.rest-assured rest-assured test diff --git a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiChangesIntegrationTest.java b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiChangesIntegrationTest.java index e2e4b547..4e652c84 100644 --- a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiChangesIntegrationTest.java +++ b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiChangesIntegrationTest.java @@ -1,13 +1,13 @@ package no.ssb.klass.api.applicationtest; -import static com.jayway.restassured.RestAssured.*; +import static io.restassured.RestAssured.*; import static org.hamcrest.Matchers.*; import no.ssb.klass.testutil.TestDataProvider; import org.junit.jupiter.api.Test; import org.springframework.http.HttpStatus; -import com.jayway.restassured.http.ContentType; +import io.restassured.http.ContentType; /** * @author Mads Lundemo, SSB. diff --git a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiClassificationFamilyIntegrationTest.java b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiClassificationFamilyIntegrationTest.java index f6dd409e..23ca0b2f 100644 --- a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiClassificationFamilyIntegrationTest.java +++ b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiClassificationFamilyIntegrationTest.java @@ -1,12 +1,12 @@ package no.ssb.klass.api.applicationtest; -import static com.jayway.restassured.RestAssured.*; +import static io.restassured.RestAssured.*; import static org.hamcrest.Matchers.*; import org.junit.jupiter.api.Test; import org.springframework.http.HttpStatus; -import com.jayway.restassured.http.ContentType; +import io.restassured.http.ContentType; import no.ssb.klass.core.model.ClassificationType; diff --git a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiClassificationIntegrationTest.java b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiClassificationIntegrationTest.java index 5398bc76..2e346cbc 100644 --- a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiClassificationIntegrationTest.java +++ b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiClassificationIntegrationTest.java @@ -1,13 +1,13 @@ package no.ssb.klass.api.applicationtest; -import static com.jayway.restassured.RestAssured.*; +import static io.restassured.RestAssured.*; import static org.hamcrest.Matchers.*; import no.ssb.klass.testutil.TestDataProvider; import org.junit.jupiter.api.Test; import org.springframework.http.HttpStatus; -import com.jayway.restassured.http.ContentType; +import io.restassured.http.ContentType; /** diff --git a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCodeAtIntegrationTest.java b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCodeAtIntegrationTest.java index 61e24f24..add17d75 100644 --- a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCodeAtIntegrationTest.java +++ b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCodeAtIntegrationTest.java @@ -1,11 +1,11 @@ package no.ssb.klass.api.applicationtest; -import com.jayway.restassured.http.ContentType; +import io.restassured.http.ContentType; import no.ssb.klass.testutil.TestDataProvider; import org.junit.jupiter.api.Test; import org.springframework.http.HttpStatus; -import static com.jayway.restassured.RestAssured.given; +import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; @@ -205,7 +205,7 @@ public void restServiceCodesAt2015CSV() { .statusCode(HttpStatus.OK.value()) .contentType(CONTENT_TYPE_CSV) - .content(containsString( + .body(containsString( "\"code\",\"parentCode\",\"level\",\"name\",\"shortName\",\"presentationName\",\"validFrom\",\"validTo\",\"notes\"\n" + "\"0101\",,\"1\",\"Halden\",\"\",\"\",,,\"\"\n" + "\"0104\",,\"1\",\"Moss\",\"\",\"\",,,\"\"\n" @@ -225,7 +225,7 @@ public void restServiceCodesAtFutureDateIncludedFutureVersionCSV() { .statusCode(HttpStatus.OK.value()) .contentType(CONTENT_TYPE_CSV) - .content(containsString( + .body(containsString( "\"code\",\"parentCode\",\"level\",\"name\",\"shortName\",\"presentationName\",\"validFrom\",\"validTo\",\"notes\"\n" + "\"0101\",,\"1\",\"Halden\",\"\",\"\",,,\"\"\n" + "\"0104\",,\"1\",\"Moss\",\"\",\"\",,,\"\"\n" @@ -250,7 +250,7 @@ public void restServiceCodesAt2012CSV() { .statusCode(HttpStatus.OK.value()) .contentType(CONTENT_TYPE_CSV) - .content(containsString( + .body(containsString( "\"code\",\"parentCode\",\"level\",\"name\",\"shortName\",\"presentationName\",\"validFrom\",\"validTo\",\"notes\"\n" + "\"0101\",,\"1\",\"Halden\",\"\",\"\",,,\"\"\n" + "\"0104\",,\"1\",\"Moss\",\"\",\"\",,,\"\"\n" + "\"0301\",,\"1\",\"Oslo\",\"\",\"\",,,\"\"\n" @@ -274,7 +274,7 @@ public void restServiceCodesAtAlternativeCSVSeparator() { .statusCode(HttpStatus.OK.value()) .contentType(CONTENT_TYPE_CSV) - .content(containsString( + .body(containsString( "\"code\";\"parentCode\";\"level\";\"name\";\"shortName\";\"presentationName\";\"validFrom\";\"validTo\";\"notes\"\n" + "\"0101\";;\"1\";\"Halden\";\"\";\"\";;;\"\"\n" + "\"0104\";;\"1\";\"Moss\";\"\";\"\";;;\"\"\n" diff --git a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCodeIntegrationTest.java b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCodeIntegrationTest.java index 5599d1da..7f71894b 100644 --- a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCodeIntegrationTest.java +++ b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCodeIntegrationTest.java @@ -1,11 +1,11 @@ package no.ssb.klass.api.applicationtest; -import com.jayway.restassured.http.ContentType; +import io.restassured.http.ContentType; import no.ssb.klass.testutil.TestDataProvider; import org.junit.jupiter.api.Test; import org.springframework.http.HttpStatus; -import static com.jayway.restassured.RestAssured.given; +import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; @@ -172,7 +172,7 @@ public void restServiceCodesCSV() { .statusCode(HttpStatus.OK.value()) .contentType(CONTENT_TYPE_CSV) - .content(containsString( + .body(containsString( "\"code\",\"parentCode\",\"level\",\"name\",\"shortName\",\"presentationName\"," + "\"validFrom\",\"validTo\",\"validFromInRequestedRange\",\"validToInRequestedRange\",\"notes\"\n" + "\"0101\",,\"1\",\"Halden\",\"\",\"\",,,\"2014-01-01\",\"2015-01-01\",\"\"\n" @@ -193,7 +193,7 @@ public void restServiceCodesIncludeFutureVersionCSV() { .statusCode(HttpStatus.OK.value()) .contentType(CONTENT_TYPE_CSV) - .content(containsString( + .body(containsString( "\"code\",\"parentCode\",\"level\",\"name\",\"shortName\",\"presentationName\"," + "\"validFrom\",\"validTo\",\"validFromInRequestedRange\",\"validToInRequestedRange\",\"notes\"\n" + "\"0101\",,\"1\",\"Halden\",\"\",\"\",,,\""+TestDataProvider.TEN_YEARS_LATER_DATE+"\",\""+TestDataProvider.FIFTEEN_YEARS_LATER_DATE+"\",\"\"\n" diff --git a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCorrespondenceTablesIntegrationTest.java b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCorrespondenceTablesIntegrationTest.java index 18630014..e4a7f67b 100644 --- a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCorrespondenceTablesIntegrationTest.java +++ b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCorrespondenceTablesIntegrationTest.java @@ -1,10 +1,10 @@ package no.ssb.klass.api.applicationtest; -import com.jayway.restassured.http.ContentType; +import io.restassured.http.ContentType; import org.junit.jupiter.api.Test; import org.springframework.http.HttpStatus; -import static com.jayway.restassured.RestAssured.given; +import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.*; public class RestApiCorrespondenceTablesIntegrationTest extends AbstractRestApiApplicationTest { @@ -79,7 +79,7 @@ public void restServiceCorrespondenceTablesCSV() { .then() .statusCode(HttpStatus.OK.value()) .contentType(CONTENT_TYPE_CSV) - .content(containsString( + .body(containsString( "\"sourceCode\";\"sourceName\";\"targetCode\";\"targetName\"\n" + "\"0301\";\"Oslo\";\"030101\";\"Gamle Oslo\"\n" + "\"0301\";\"Oslo\";\"030102\";\"Grünerløkka\"\n" + diff --git a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCorrespondsAtIntegrationTest.java b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCorrespondsAtIntegrationTest.java index a076e564..b412d204 100644 --- a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCorrespondsAtIntegrationTest.java +++ b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCorrespondsAtIntegrationTest.java @@ -1,11 +1,11 @@ package no.ssb.klass.api.applicationtest; -import com.jayway.restassured.http.ContentType; +import io.restassured.http.ContentType; import no.ssb.klass.testutil.TestDataProvider; import org.junit.jupiter.api.Test; import org.springframework.http.HttpStatus; -import static com.jayway.restassured.RestAssured.given; +import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; @@ -169,7 +169,7 @@ public void restServiceCorrespondsCSV() { // .prettyPeek() .then() .statusCode(HttpStatus.OK.value()) - .content(containsString( + .body(containsString( "\"sourceCode\",\"sourceName\",\"sourceShortName\",\"targetCode\",\"targetName\",\"targetShortName\"\n" + "\"0301\",\"Oslo\",\"\",\"030101\",\"Gamle Oslo\",\"\"\n" + "\"0301\",\"Oslo\",\"\",\"030102\",\"Grünerløkka\",\"\"\n" @@ -187,7 +187,7 @@ public void restServiceCorrespondsIncludeFutureVersionCSV() { // .prettyPeek() .then() .statusCode(HttpStatus.OK.value()) - .content(containsString( + .body(containsString( "\"sourceCode\",\"sourceName\",\"sourceShortName\",\"targetCode\",\"targetName\",\"targetShortName\"\n" + "\"0301\",\"Oslo\",\"\",\"030101\",\"Gamle Oslo\",\"\"\n" + "\"0301\",\"Oslo\",\"\",\"030102\",\"Grünerløkka\",\"\"\n" diff --git a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCorrespondsIntegrationTest.java b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCorrespondsIntegrationTest.java index 390a087a..cd935f27 100644 --- a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCorrespondsIntegrationTest.java +++ b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiCorrespondsIntegrationTest.java @@ -1,6 +1,6 @@ package no.ssb.klass.api.applicationtest; -import static com.jayway.restassured.RestAssured.*; +import static io.restassured.RestAssured.*; import static org.hamcrest.Matchers.*; import no.ssb.klass.testutil.TestDataProvider; @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test; import org.springframework.http.HttpStatus; -import com.jayway.restassured.http.ContentType; +import io.restassured.http.ContentType; /** * @author Mads Lundemo, SSB. @@ -174,7 +174,7 @@ public void restServiceCorrespondsCSV() { // .prettyPeek() .then() .statusCode(HttpStatus.OK.value()) - .content(containsString( + .body(containsString( "\"sourceCode\",\"sourceName\",\"sourceShortName\",\"targetCode\",\"targetName\"," + "\"targetShortName\",\"validFrom\",\"validTo\"\n" + "\"0301\",\"Oslo\",\"\",\"030101\",\"Gamle Oslo\",\"\",\"2015-01-01\",\n" @@ -193,7 +193,7 @@ public void restServiceCorrespondsIncludeFutureVersionCSV() { // .prettyPeek() .then() .statusCode(HttpStatus.OK.value()) - .content(containsString( + .body(containsString( "\"sourceCode\",\"sourceName\",\"sourceShortName\",\"targetCode\",\"targetName\"," + "\"targetShortName\",\"validFrom\",\"validTo\"\n" + "\"0301\",\"Oslo\",\"\",\"030101\",\"Gamle Oslo\",\"\",\"2015-01-01\",\n" diff --git a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiDraftIntegrationTest.java b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiDraftIntegrationTest.java index aeb74474..26ee58fb 100644 --- a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiDraftIntegrationTest.java +++ b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiDraftIntegrationTest.java @@ -1,6 +1,6 @@ package no.ssb.klass.api.applicationtest; -import static com.jayway.restassured.RestAssured.*; +import static io.restassured.RestAssured.*; import static org.hamcrest.Matchers.*; import no.ssb.klass.testutil.TestDataProvider; @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test; import org.springframework.http.HttpStatus; -import com.jayway.restassured.http.ContentType; +import io.restassured.http.ContentType; import no.ssb.klass.core.model.ClassificationFamily; import no.ssb.klass.core.model.ClassificationVariant; diff --git a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiErrorHandlingIntegrationTest.java b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiErrorHandlingIntegrationTest.java index 147b50cd..f7ffd6cf 100644 --- a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiErrorHandlingIntegrationTest.java +++ b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiErrorHandlingIntegrationTest.java @@ -1,11 +1,11 @@ package no.ssb.klass.api.applicationtest; -import static com.jayway.restassured.RestAssured.*; +import static io.restassured.RestAssured.*; import org.junit.jupiter.api.Test; import org.springframework.http.HttpStatus; -import com.jayway.restassured.http.ContentType; +import io.restassured.http.ContentType; /** * @author Mads Lundemo, SSB. diff --git a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiListClassificationFamilyIntegrationTest.java b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiListClassificationFamilyIntegrationTest.java index 00131aee..54aa0f4f 100644 --- a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiListClassificationFamilyIntegrationTest.java +++ b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiListClassificationFamilyIntegrationTest.java @@ -1,12 +1,12 @@ package no.ssb.klass.api.applicationtest; -import static com.jayway.restassured.RestAssured.*; +import static io.restassured.RestAssured.*; import static org.hamcrest.Matchers.*; import org.junit.jupiter.api.Test; import org.springframework.http.HttpStatus; -import com.jayway.restassured.http.ContentType; +import io.restassured.http.ContentType; import no.ssb.klass.core.model.ClassificationType; diff --git a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiListClassificationIntegrationTest.java b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiListClassificationIntegrationTest.java index 0b08cd58..7e34567b 100644 --- a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiListClassificationIntegrationTest.java +++ b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiListClassificationIntegrationTest.java @@ -1,13 +1,13 @@ package no.ssb.klass.api.applicationtest; -import static com.jayway.restassured.RestAssured.*; +import static io.restassured.RestAssured.*; import static org.hamcrest.Matchers.*; import no.ssb.klass.testutil.TestDataProvider; import org.junit.jupiter.api.Test; import org.springframework.http.HttpStatus; -import com.jayway.restassured.http.ContentType; +import io.restassured.http.ContentType; /** diff --git a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiListSsbSectionIntegrationTest.java b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiListSsbSectionIntegrationTest.java index 8ab475e8..dd4c5ca8 100644 --- a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiListSsbSectionIntegrationTest.java +++ b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiListSsbSectionIntegrationTest.java @@ -1,12 +1,12 @@ package no.ssb.klass.api.applicationtest; -import static com.jayway.restassured.RestAssured.*; +import static io.restassured.RestAssured.*; import static org.hamcrest.Matchers.*; import org.junit.jupiter.api.Test; import org.springframework.http.HttpStatus; -import com.jayway.restassured.http.ContentType; +import io.restassured.http.ContentType; /** * Testsuite that test the list (all) ssb sections diff --git a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiSearchIntegrationTest.java b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiSearchIntegrationTest.java index 6f3fbdd0..8eca1bfd 100644 --- a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiSearchIntegrationTest.java +++ b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiSearchIntegrationTest.java @@ -1,6 +1,6 @@ package no.ssb.klass.api.applicationtest; -import static com.jayway.restassured.RestAssured.*; +import static io.restassured.RestAssured.*; import static org.hamcrest.Matchers.*; import no.ssb.klass.testutil.TestDataProvider; @@ -8,7 +8,7 @@ import org.springframework.http.HttpStatus; import org.springframework.test.context.ActiveProfiles; -import com.jayway.restassured.http.ContentType; +import io.restassured.http.ContentType; import no.ssb.klass.core.config.ConfigurationProfiles; diff --git a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiVariantAtIntegrationTest.java b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiVariantAtIntegrationTest.java index a8173ee7..848e8bff 100644 --- a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiVariantAtIntegrationTest.java +++ b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiVariantAtIntegrationTest.java @@ -1,11 +1,11 @@ package no.ssb.klass.api.applicationtest; -import com.jayway.restassured.http.ContentType; +import io.restassured.http.ContentType; import no.ssb.klass.testutil.TestDataProvider; import org.junit.jupiter.api.Test; import org.springframework.http.HttpStatus; -import static com.jayway.restassured.RestAssured.given; +import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; @@ -154,7 +154,7 @@ public void restServiceVariantAtCSV() { .then() .statusCode(HttpStatus.OK.value()) .contentType(CONTENT_TYPE_CSV) - .content(containsString( + .body(containsString( "\"code\",\"parentCode\",\"level\",\"name\",\"shortName\",\"presentationName\",\"validFrom\",\"validTo\",\"notes\"\n" + "\"A\",,\"1\",\"Enpersonfamilie\",\"\",\"\",,,\"\"\n" + "\"A_\",\"A\",\"2\",\"Enpersonfamilie\",\"\",\"\",,,\"\"\n" @@ -174,7 +174,7 @@ public void restServiceVariantAtIncludedFutureVersionsCSV() { .then() .statusCode(HttpStatus.OK.value()) .contentType(CONTENT_TYPE_CSV) - .content(containsString( + .body(containsString( "\"code\",\"parentCode\",\"level\",\"name\",\"shortName\",\"presentationName\",\"validFrom\",\"validTo\",\"notes\"\n" + "\"C\",,\"1\",\"Enslig person med barn\",\"\",\"\",,,\"\"\n" + "\"CA\",\"C\",\"2\",\"Enslig person med barn 0-5 år\",\"\",\"\",,,\"\"\n" @@ -194,7 +194,7 @@ public void restServiceVariantAtCSVFullVariantName() { .then() .statusCode(HttpStatus.OK.value()) .contentType(CONTENT_TYPE_CSV) - .content(containsString( + .body(containsString( "\"code\",\"parentCode\",\"level\",\"name\",\"shortName\",\"presentationName\",\"validFrom\",\"validTo\",\"notes\"\n" + "\"A\",,\"1\",\"Enpersonfamilie\",\"\",\"\",,,\"\"\n" + "\"A_\",\"A\",\"2\",\"Enpersonfamilie\",\"\",\"\",,,\"\"\n" @@ -217,7 +217,7 @@ public void restServiceVariantAtCSVFullVariantNameFutureVersion() { .then() .statusCode(HttpStatus.OK.value()) .contentType(CONTENT_TYPE_CSV) - .content(containsString( + .body(containsString( "\"code\",\"parentCode\",\"level\",\"name\",\"shortName\",\"presentationName\",\"validFrom\",\"validTo\",\"notes\"\n" + "\"C\",,\"1\",\"Enslig person med barn\",\"\",\"\",,,\"\"\n" + "\"CA\",\"C\",\"2\",\"Enslig person med barn 0-5 år\",\"\",\"\",,,\"\"\n" diff --git a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiVariantIntegrationTest.java b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiVariantIntegrationTest.java index 9e17263d..30c18fe4 100644 --- a/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiVariantIntegrationTest.java +++ b/klass-api/src/test/java/no/ssb/klass/api/applicationtest/RestApiVariantIntegrationTest.java @@ -1,11 +1,11 @@ package no.ssb.klass.api.applicationtest; -import com.jayway.restassured.http.ContentType; +import io.restassured.http.ContentType; import no.ssb.klass.testutil.TestDataProvider; import org.junit.jupiter.api.Test; import org.springframework.http.HttpStatus; -import static com.jayway.restassured.RestAssured.given; +import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; @@ -242,7 +242,7 @@ public void restServiceVariantCSV() { .then() .statusCode(HttpStatus.OK.value()) .contentType(CONTENT_TYPE_CSV) - .content(containsString( + .body(containsString( "\"code\",\"parentCode\",\"level\",\"name\",\"shortName\",\"presentationName\"," + "\"validFrom\",\"validTo\",\"validFromInRequestedRange\",\"validToInRequestedRange\",\"notes\"\n" + "\"A\",,\"1\",\"Enpersonfamilie\",\"\",\"\",,,\"2014-01-01\",,\"\"\n" @@ -263,7 +263,7 @@ public void restServiceVariantIncludeFutureVersionsCSV() { .then() .statusCode(HttpStatus.OK.value()) .contentType(CONTENT_TYPE_CSV) - .content(containsString( + .body(containsString( "\"code\",\"parentCode\",\"level\",\"name\",\"shortName\",\"presentationName\"," + "\"validFrom\",\"validTo\",\"validFromInRequestedRange\",\"validToInRequestedRange\",\"notes\"\n" + "\"A\",,\"1\",\"Enpersonfamilie\",\"\",\"\",,,\"2014-01-01\",\""+TestDataProvider.TEN_YEARS_LATER_DATE+"\",\"\"\n" diff --git a/klass-api/src/test/java/no/ssb/klass/api/dto/hal/ClassificationResourceTest.java b/klass-api/src/test/java/no/ssb/klass/api/dto/hal/ClassificationResourceTest.java index 4f0f6181..872e7435 100644 --- a/klass-api/src/test/java/no/ssb/klass/api/dto/hal/ClassificationResourceTest.java +++ b/klass-api/src/test/java/no/ssb/klass/api/dto/hal/ClassificationResourceTest.java @@ -32,7 +32,7 @@ public void create() { // then assertEquals(name, subject.getName()); - assertEquals("http://localhost" + RestConstants.API_VERSION_V1 + "/classifications/" + id, subject.getLink("self")); + assertEquals("http://localhost" + RestConstants.API_VERSION_V1 + "/classifications/" + id, subject.getLink("self").orElseThrow()); assertEquals(0, subject.getVersions().size()); } diff --git a/klass-shared/pom.xml b/klass-shared/pom.xml index f7f025bd..08e8d47e 100644 --- a/klass-shared/pom.xml +++ b/klass-shared/pom.xml @@ -34,7 +34,7 @@ 19.0 4.4.1 3.12.0 - 2.9.0 + 5.4.0 1.5.7 1.6.0 3.1.0 @@ -195,7 +195,7 @@ ${woodstox-version} - com.jayway.restassured + io.rest-assured rest-assured ${rest-assured-version} test diff --git a/klass-shared/src/main/java/no/ssb/klass/core/model/Changelog.java b/klass-shared/src/main/java/no/ssb/klass/core/model/Changelog.java index 5dce7c36..0c20814a 100644 --- a/klass-shared/src/main/java/no/ssb/klass/core/model/Changelog.java +++ b/klass-shared/src/main/java/no/ssb/klass/core/model/Changelog.java @@ -12,11 +12,11 @@ @Entity public class Changelog extends BaseEntity { @Column(nullable = false) - private final Date changeOccured; + private Date changeOccured; @Column(nullable = false) - private final String changedBy; + private String changedBy; @Column(length = 4096, nullable = false) - private final String description; + private String description; public Changelog(String changedBy, String description) { this.changeOccured = TimeUtil.now(); @@ -24,6 +24,9 @@ public Changelog(String changedBy, String description) { this.description = checkNotNull(description); } + protected Changelog() { + } + public Date getChangeOccured() { return changeOccured; } diff --git a/klass-shared/src/main/java/no/ssb/klass/core/model/ClassificationItem.java b/klass-shared/src/main/java/no/ssb/klass/core/model/ClassificationItem.java index c312edca..e223fa29 100644 --- a/klass-shared/src/main/java/no/ssb/klass/core/model/ClassificationItem.java +++ b/klass-shared/src/main/java/no/ssb/klass/core/model/ClassificationItem.java @@ -1,5 +1,6 @@ package no.ssb.klass.core.model; +import jakarta.persistence.Column; import no.ssb.klass.core.util.AlphaNumericCompareUtil; import java.time.LocalDate; @@ -25,6 +26,7 @@ void setParent(ClassificationItem parent) { /** * @return code, never null */ + @Column(nullable = false) public abstract String getCode(); /** diff --git a/klass-shared/src/main/java/no/ssb/klass/core/model/ClassificationVariant.java b/klass-shared/src/main/java/no/ssb/klass/core/model/ClassificationVariant.java index bd5054f9..7c45aad3 100644 --- a/klass-shared/src/main/java/no/ssb/klass/core/model/ClassificationVariant.java +++ b/klass-shared/src/main/java/no/ssb/klass/core/model/ClassificationVariant.java @@ -37,6 +37,9 @@ public ClassificationVariant(Translatable name, User contactPerson) { super.addLevel(new Level(2)); } + protected ClassificationVariant() { + } + public void setClassificationVersion(ClassificationVersion classificationVersion) { this.classificationVersion = classificationVersion; } diff --git a/klass-shared/src/main/java/no/ssb/klass/core/model/CorrespondenceMap.java b/klass-shared/src/main/java/no/ssb/klass/core/model/CorrespondenceMap.java index 0776159b..8a56a687 100644 --- a/klass-shared/src/main/java/no/ssb/klass/core/model/CorrespondenceMap.java +++ b/klass-shared/src/main/java/no/ssb/klass/core/model/CorrespondenceMap.java @@ -27,6 +27,9 @@ public CorrespondenceMap(ClassificationItem source, ClassificationItem target) { this.target = target; } + protected CorrespondenceMap() { + } + public Optional getSource() { return Optional.ofNullable(source); } diff --git a/klass-shared/src/main/java/no/ssb/klass/core/model/CorrespondenceTable.java b/klass-shared/src/main/java/no/ssb/klass/core/model/CorrespondenceTable.java index ba70417a..90e1e5c5 100644 --- a/klass-shared/src/main/java/no/ssb/klass/core/model/CorrespondenceTable.java +++ b/klass-shared/src/main/java/no/ssb/klass/core/model/CorrespondenceTable.java @@ -38,21 +38,24 @@ public class CorrespondenceTable extends BaseEntity implements ClassificationEnt private Translatable description; private Published published; @ManyToOne(optional = false, fetch = FetchType.LAZY) - private final ClassificationVersion source; - private final int sourceLevelNumber; + private ClassificationVersion source; + private int sourceLevelNumber; @ManyToOne(optional = false, fetch = FetchType.LAZY) - private final ClassificationVersion target; - private final int targetLevelNumber; + private ClassificationVersion target; + private int targetLevelNumber; @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, mappedBy = "correspondenceTable") - private final List correspondenceMaps; + private List correspondenceMaps; @OneToMany(cascade = CascadeType.ALL) @JoinTable(name = "correspondencetable_changelog", joinColumns = @JoinColumn(name = "correspondencetable_id"), inverseJoinColumns = @JoinColumn(name = "changelog_id")) - private final List changelogs; + private List changelogs; @Column(nullable = false) private boolean deleted; @Column(nullable = false) private boolean draft; + protected CorrespondenceTable() { + } + /** * Creates a CorrespondenceTable * diff --git a/klass-shared/src/main/java/no/ssb/klass/core/model/User.java b/klass-shared/src/main/java/no/ssb/klass/core/model/User.java index 09ca0cfd..a6399b57 100644 --- a/klass-shared/src/main/java/no/ssb/klass/core/model/User.java +++ b/klass-shared/src/main/java/no/ssb/klass/core/model/User.java @@ -18,7 +18,7 @@ }) public class User extends BaseEntity { @Column(nullable = false) - private final String username; + private String username; @Column(nullable = false) private String fullname; @Column(nullable = false) @@ -32,7 +32,7 @@ public class User extends BaseEntity { @ManyToMany // Uses Set instead of List, see http://lkumarjain.blogspot.no/2013/07/why-hibernate-does-delete-all-entries.html - private final Set favorites; + private Set favorites; public User(String username, String fullname, String section) { this.username = checkNotNull(username); @@ -42,6 +42,9 @@ public User(String username, String fullname, String section) { this.favorites = new HashSet<>(); } + protected User() { + } + public String getSection() { return section; } diff --git a/klass-shared/src/test/java/no/ssb/klass/core/repository/ReferencingClassificationItemRepositoryTest.java b/klass-shared/src/test/java/no/ssb/klass/core/repository/ReferencingClassificationItemRepositoryTest.java index eec1f055..90613e31 100644 --- a/klass-shared/src/test/java/no/ssb/klass/core/repository/ReferencingClassificationItemRepositoryTest.java +++ b/klass-shared/src/test/java/no/ssb/klass/core/repository/ReferencingClassificationItemRepositoryTest.java @@ -1,6 +1,5 @@ package no.ssb.klass.core.repository; -import static org.hamcrest.core.Is.*; import static org.assertj.core.api.Assertions.*; import java.util.List; @@ -162,8 +161,7 @@ private ClassificationVariant createAndSaveVariant(String name, int itemCount, b source.addClassificationVariant(variant); variant.setClassificationVersion(source); - for (int i = 0; i < itemCount; i++) { - ClassificationItem sourceItem = source.getAllClassificationItems().get(i); + for (ClassificationItem sourceItem: source.getAllClassificationItems()) { ClassificationItem item = new ReferencingClassificationItem(sourceItem); variant.addClassificationItem(item, 1, null); } diff --git a/pom.xml b/pom.xml index 28b2ced4..2b22ee84 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ local 4.4.1 3.4 - 2.9.0 + 5.4.0 1.5.5 2.2.4 0.15.3 @@ -76,7 +76,7 @@ import - com.jayway.restassured + io.rest-assured rest-assured ${rest-assured-version} test