From 8de2ec1efde125a07608011bba27943db9022dfd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Nov 2023 11:26:49 +0000 Subject: [PATCH 1/9] chore(deps): Bump org.springframework.boot from 3.1.5 to 3.2.0 Bumps [org.springframework.boot](https://github.com/spring-projects/spring-boot) from 3.1.5 to 3.2.0. - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.1.5...v3.2.0) --- updated-dependencies: - dependency-name: org.springframework.boot dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index c73b3aa6c..ea09788b2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,7 +19,7 @@ plugins { `kotlin-dsl` // only apply the plugin in the subprojects requiring it because it expects a Spring Boot app // and the shared lib is obviously not one - id("org.springframework.boot") version "3.1.5" apply false + id("org.springframework.boot") version "3.2.0" apply false id("io.spring.dependency-management") version "1.1.4" apply false id("org.graalvm.buildtools.native") version "0.9.28" kotlin("jvm") version "1.9.21" apply false From 4d5908b2045d88486932265018b52c85635cceb3 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 27 Nov 2023 12:59:36 +0100 Subject: [PATCH 2/9] feat(WIP): prepare for upgrade to Spring Boot 3.2 / Java 21 --- .github/workflows/anchore.yml | 4 ++-- .github/workflows/build.yml | 4 ++-- .github/workflows/codeql.yml | 4 ++-- build.gradle.kts | 5 ++--- gradle/wrapper/gradle-wrapper.properties | 2 +- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/anchore.yml b/.github/workflows/anchore.yml index 49f529e52..71677b6dc 100644 --- a/.github/workflows/anchore.yml +++ b/.github/workflows/anchore.yml @@ -11,11 +11,11 @@ jobs: steps: - name: Checkout project uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '21' - name: Assemble project uses: gradle/gradle-build-action@v2 with: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 722bd9afd..07721d2a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,11 +17,11 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '21' cache: 'gradle' - name: Cache SonarCloud packages uses: actions/cache@v3 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 418429212..6c46f921b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -31,11 +31,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '21' # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/build.gradle.kts b/build.gradle.kts index ea09788b2..b399f95c5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,3 @@ - import com.google.cloud.tools.jib.gradle.PlatformParameters import io.gitlab.arturbosch.detekt.Detekt import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask @@ -42,7 +41,7 @@ subprojects { apply(plugin = "io.gitlab.arturbosch.detekt") apply(plugin = "jacoco") - java.sourceCompatibility = JavaVersion.VERSION_17 + java.sourceCompatibility = JavaVersion.VERSION_21 the().apply { imports { @@ -88,7 +87,7 @@ subprojects { tasks.withType { kotlinOptions { freeCompilerArgs = listOf("-Xjsr305=strict", "-opt-in=kotlin.RequiresOptIn") - jvmTarget = "${JavaVersion.VERSION_17}" + jvmTarget = "${JavaVersion.VERSION_21}" } } tasks.withType { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index bdc9a83b1..744c64d12 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 9fb0765fc1e20f59c9666ac5b728513d03b05d11 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 27 Nov 2023 14:36:32 +0100 Subject: [PATCH 3/9] chore: align more versions for Java 21 compatibility --- build.gradle.kts | 8 ++++---- .../kotlin/com/egm/stellio/shared/util/UriUtilsTests.kt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index b399f95c5..47ab9eb95 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,7 @@ buildscript { } } -extra["springCloudVersion"] = "2022.0.2" +extra["springCloudVersion"] = "2023.0.0-RC1" plugins { // https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/htmlsingle/#reacting-to-other-plugins.java @@ -24,7 +24,7 @@ plugins { kotlin("jvm") version "1.9.21" apply false kotlin("plugin.spring") version "1.9.21" apply false id("com.google.cloud.tools.jib") version "3.4.0" apply false - id("io.gitlab.arturbosch.detekt") version "1.23.3" apply false + id("io.gitlab.arturbosch.detekt") version "1.23.4" apply false id("org.sonarqube") version "4.4.1.3373" jacoco } @@ -102,7 +102,7 @@ subprojects { configurations.matching { it.name == "detekt" }.all { resolutionStrategy.eachDependency { if (requested.group == "org.jetbrains.kotlin") { - useVersion("1.9.10") + useVersion("1.9.21") } } } @@ -126,7 +126,7 @@ subprojects { // see https://docs.gradle.org/current/userguide/jacoco_plugin.html for configuration instructions jacoco { - toolVersion = "0.8.7" + toolVersion = "0.8.9" } tasks.test { finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run diff --git a/shared/src/test/kotlin/com/egm/stellio/shared/util/UriUtilsTests.kt b/shared/src/test/kotlin/com/egm/stellio/shared/util/UriUtilsTests.kt index 25cc3e15a..bf1aa85d3 100644 --- a/shared/src/test/kotlin/com/egm/stellio/shared/util/UriUtilsTests.kt +++ b/shared/src/test/kotlin/com/egm/stellio/shared/util/UriUtilsTests.kt @@ -29,7 +29,7 @@ class UriUtilsTests { } Assertions.assertEquals( "The supplied identifier was expected to be an URI but it is not: https://just\\AString " + - "(cause was: java.net.URISyntaxException: Illegal character in authority at index 8: " + + "(cause was: java.net.URISyntaxException: Illegal character in authority at index 12: " + "https://just\\AString)", exception.message ) From 83828bedd33fd4586ae7f9ee5b77d9f2941acf0c Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Fri, 1 Dec 2023 07:36:08 +0100 Subject: [PATCH 4/9] feat(WIP): upgrade to SB 3.2 / Java 21 - remove no longer needed @OptIn annotation to use runTest - add a WebSecurityTestConfig to inject a required authentication manager --- .sdkmanrc | 2 +- build.gradle.kts | 2 +- .../search/authorization/AuthUtilsTests.kt | 2 -- .../authorization/AuthorizationServiceTests.kt | 2 -- .../EnabledAuthorizationServiceTests.kt | 2 -- .../EntityAccessRightsServiceTests.kt | 2 -- .../SubjectReferentialServiceTests.kt | 2 -- .../search/config/WebSecurityTestConfig.kt | 17 +++++++++++++++++ .../stellio/search/listener/IAMListenerTests.kt | 2 -- .../listener/ObservationEventListenerTests.kt | 2 -- .../stellio/search/scope/ScopeServiceTests.kt | 2 -- .../service/AggregatedQueryServiceTests.kt | 2 -- .../service/AttributeInstanceServiceTests.kt | 2 -- .../search/service/AttributeServiceTests.kt | 2 -- .../search/service/EntityEventServiceTests.kt | 2 -- .../service/EntityOperationServiceTests.kt | 2 -- .../search/service/EntityPayloadServiceTests.kt | 2 -- .../search/service/EntityQueryServiceTests.kt | 2 -- .../search/service/EntityTypeServiceTests.kt | 2 -- .../TemporalEntityAttributeServiceTests.kt | 2 -- .../search/util/AttributeInstanceUtilsTests.kt | 2 -- .../search/util/EntitiesQueryUtilsTests.kt | 2 -- .../search/web/AnonymousUserHandlerTests.kt | 3 +++ .../stellio/search/web/AttributeHandlerTests.kt | 3 +++ .../web/EntityAccessControlHandlerTests.kt | 5 +++-- .../stellio/search/web/EntityHandlerTests.kt | 3 +++ .../search/web/EntityOperationHandlerTests.kt | 5 +++-- .../search/web/EntityTypeHandlerTests.kt | 3 +++ .../search/web/TemporalEntityHandlerTests.kt | 5 +++-- .../web/TemporalEntityOperationsHandlerTests.kt | 3 +++ .../db/migration/V0_29_JsonLd_migrationTests.kt | 2 -- .../stellio/shared/model/JsonLdEntityTests.kt | 2 -- .../stellio/shared/model/NgsiLdEntityTests.kt | 2 -- .../egm/stellio/shared/util/ApiUtilsTests.kt | 2 -- .../shared/util/DataRepresentationUtilsTests.kt | 2 -- .../stellio/shared/util/GeoQueryUtilsTests.kt | 2 -- .../egm/stellio/shared/util/JsonLdUtilsTests.kt | 2 -- .../egm/stellio/shared/util/JsonUtilsTests.kt | 2 -- .../job/TimeIntervalNotificationJobTest.kt | 2 -- .../listener/EntityEventListenerServiceTests.kt | 2 -- .../service/NotificationServiceTests.kt | 2 -- .../service/SubscriptionServiceTests.kt | 2 -- .../subscription/utils/ParsingUtilsTests.kt | 2 -- .../web/SubscriptionHandlerTests.kt | 2 -- 44 files changed, 43 insertions(+), 74 deletions(-) create mode 100644 search-service/src/test/kotlin/com/egm/stellio/search/config/WebSecurityTestConfig.kt diff --git a/.sdkmanrc b/.sdkmanrc index 272da7dcf..bc36ae5d2 100644 --- a/.sdkmanrc +++ b/.sdkmanrc @@ -1,3 +1,3 @@ # Enable auto-env through the sdkman_auto_env config # Add key=value pairs of SDKs to use below -java=17.0.8-tem +java=21-tem diff --git a/build.gradle.kts b/build.gradle.kts index 47ab9eb95..0d9905264 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -86,7 +86,7 @@ subprojects { tasks.withType { kotlinOptions { - freeCompilerArgs = listOf("-Xjsr305=strict", "-opt-in=kotlin.RequiresOptIn") + freeCompilerArgs = listOf("-Xjsr305=strict") jvmTarget = "${JavaVersion.VERSION_21}" } } diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/authorization/AuthUtilsTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/authorization/AuthUtilsTests.kt index 4f03b3416..76672376a 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/authorization/AuthUtilsTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/authorization/AuthUtilsTests.kt @@ -6,13 +6,11 @@ import com.egm.stellio.shared.util.* import com.egm.stellio.shared.util.AuthContextModel.AUTHORIZATION_API_DEFAULT_CONTEXTS import com.egm.stellio.shared.util.AuthContextModel.AUTH_TERM_SAP import com.egm.stellio.shared.util.JsonLdUtils.expandAttribute -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test -@OptIn(ExperimentalCoroutinesApi::class) class AuthUtilsTests { @Test diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/authorization/AuthorizationServiceTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/authorization/AuthorizationServiceTests.kt index d1dd29e44..3b2b68514 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/authorization/AuthorizationServiceTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/authorization/AuthorizationServiceTests.kt @@ -8,13 +8,11 @@ import com.egm.stellio.shared.util.JsonLdUtils.NGSILD_CORE_CONTEXT import com.egm.stellio.shared.util.shouldSucceedWith import com.egm.stellio.shared.util.toUri import io.mockk.spyk -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.junit.jupiter.api.fail -@OptIn(ExperimentalCoroutinesApi::class) class AuthorizationServiceTests { private val authorizationService = spyk(DisabledAuthorizationService()) diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/authorization/EnabledAuthorizationServiceTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/authorization/EnabledAuthorizationServiceTests.kt index e9f5a8182..f1b3508c9 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/authorization/EnabledAuthorizationServiceTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/authorization/EnabledAuthorizationServiceTests.kt @@ -20,7 +20,6 @@ import com.ninjasquad.springmockk.MockkBean import io.mockk.coEvery import io.mockk.coVerify import io.mockk.coVerifyAll -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.Test @@ -30,7 +29,6 @@ import org.springframework.test.context.ActiveProfiles import java.net.URI import java.util.UUID -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = [EnabledAuthorizationService::class]) @ActiveProfiles("test") class EnabledAuthorizationServiceTests { diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/authorization/EntityAccessRightsServiceTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/authorization/EntityAccessRightsServiceTests.kt index 2b392a9fa..83c03c1ea 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/authorization/EntityAccessRightsServiceTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/authorization/EntityAccessRightsServiceTests.kt @@ -19,7 +19,6 @@ import io.mockk.Called import io.mockk.coEvery import io.mockk.coVerify import io.r2dbc.postgresql.codec.Json -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.runBlocking import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.AfterEach @@ -36,7 +35,6 @@ import org.springframework.test.context.ActiveProfiles import java.net.URI import java.util.UUID -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest @ActiveProfiles("test") class EntityAccessRightsServiceTests : WithTimescaleContainer { diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/authorization/SubjectReferentialServiceTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/authorization/SubjectReferentialServiceTests.kt index 9c305e6e1..c27cac98e 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/authorization/SubjectReferentialServiceTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/authorization/SubjectReferentialServiceTests.kt @@ -8,7 +8,6 @@ import com.egm.stellio.shared.util.* import com.egm.stellio.shared.util.GlobalRole.STELLIO_ADMIN import com.egm.stellio.shared.util.GlobalRole.STELLIO_CREATOR import io.r2dbc.postgresql.codec.Json -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.AfterEach @@ -21,7 +20,6 @@ import org.springframework.data.r2dbc.core.R2dbcEntityTemplate import org.springframework.test.context.ActiveProfiles import java.util.UUID -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest @ActiveProfiles("test") class SubjectReferentialServiceTests : WithTimescaleContainer { diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/config/WebSecurityTestConfig.kt b/search-service/src/test/kotlin/com/egm/stellio/search/config/WebSecurityTestConfig.kt new file mode 100644 index 000000000..3049b3a95 --- /dev/null +++ b/search-service/src/test/kotlin/com/egm/stellio/search/config/WebSecurityTestConfig.kt @@ -0,0 +1,17 @@ +package com.egm.stellio.search.config + +import com.egm.stellio.shared.config.ApplicationProperties +import org.springframework.boot.test.context.TestConfiguration +import org.springframework.context.annotation.Bean +import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder +import org.springframework.security.oauth2.jwt.ReactiveJwtDecoders + +@TestConfiguration +class WebSecurityTestConfig( + private val applicationProperties: ApplicationProperties +) { + + @Bean + fun jwtDecoder(): ReactiveJwtDecoder = + ReactiveJwtDecoders.fromOidcIssuerLocation(applicationProperties.tenants[0].issuer) +} diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/listener/IAMListenerTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/listener/IAMListenerTests.kt index 6194e764b..2432aae42 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/listener/IAMListenerTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/listener/IAMListenerTests.kt @@ -8,14 +8,12 @@ import com.egm.stellio.shared.util.loadSampleData import com.ninjasquad.springmockk.MockkBean import io.mockk.coEvery import io.mockk.coVerify -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest import org.springframework.test.context.ActiveProfiles -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = [IAMListener::class]) @ActiveProfiles("test") class IAMListenerTests { diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/listener/ObservationEventListenerTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/listener/ObservationEventListenerTests.kt index c8349e553..da6ca7edb 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/listener/ObservationEventListenerTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/listener/ObservationEventListenerTests.kt @@ -11,7 +11,6 @@ import com.egm.stellio.shared.model.JsonLdEntity import com.egm.stellio.shared.util.* import com.ninjasquad.springmockk.MockkBean import io.mockk.* -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.Job import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Test @@ -20,7 +19,6 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest import org.springframework.test.context.ActiveProfiles -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = [ObservationEventListener::class]) @ActiveProfiles("test") class ObservationEventListenerTests { diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/scope/ScopeServiceTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/scope/ScopeServiceTests.kt index e39b4ec5c..f343e1d02 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/scope/ScopeServiceTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/scope/ScopeServiceTests.kt @@ -9,7 +9,6 @@ import com.egm.stellio.search.util.deserializeAsMap import com.egm.stellio.shared.model.PaginationQuery import com.egm.stellio.shared.model.getScopes import com.egm.stellio.shared.util.* -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.runBlocking import kotlinx.coroutines.test.runTest import org.assertj.core.api.Assertions.assertThat @@ -25,7 +24,6 @@ import org.springframework.data.r2dbc.core.R2dbcEntityTemplate import org.springframework.test.context.ActiveProfiles import java.util.stream.Stream -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest @ActiveProfiles("test") class ScopeServiceTests : WithTimescaleContainer, WithKafkaContainer { diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/service/AggregatedQueryServiceTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/service/AggregatedQueryServiceTests.kt index 173c1aca4..e72acf9bc 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/service/AggregatedQueryServiceTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/service/AggregatedQueryServiceTests.kt @@ -4,7 +4,6 @@ import com.egm.stellio.search.model.* import com.egm.stellio.search.support.* import com.egm.stellio.shared.model.OperationNotSupportedException import com.egm.stellio.shared.util.* -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.assertj.core.api.AbstractObjectAssert import org.assertj.core.api.Assertions @@ -24,7 +23,6 @@ import java.time.OffsetTime import java.time.ZonedDateTime import java.util.UUID -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest @ActiveProfiles("test") class AggregatedQueryServiceTests : WithTimescaleContainer, WithKafkaContainer { diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/service/AttributeInstanceServiceTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/service/AttributeInstanceServiceTests.kt index e309b89fa..733d27c3a 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/service/AttributeInstanceServiceTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/service/AttributeInstanceServiceTests.kt @@ -17,7 +17,6 @@ import com.egm.stellio.shared.util.JsonUtils.deserializeAsList import com.egm.stellio.shared.util.JsonUtils.deserializeAsMap import io.mockk.spyk import io.mockk.verify -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.runBlocking import kotlinx.coroutines.test.runTest import org.assertj.core.api.Assertions.assertThat @@ -35,7 +34,6 @@ import java.time.ZoneOffset import java.time.ZonedDateTime import java.util.UUID -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest @ActiveProfiles("test") class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer { diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/service/AttributeServiceTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/service/AttributeServiceTests.kt index 0bf2eca95..16c039ffb 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/service/AttributeServiceTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/service/AttributeServiceTests.kt @@ -13,7 +13,6 @@ import com.egm.stellio.shared.model.ResourceNotFoundException import com.egm.stellio.shared.util.* import com.egm.stellio.shared.util.JsonLdUtils.NGSILD_LOCATION_PROPERTY import com.egm.stellio.shared.util.JsonLdUtils.NGSILD_LOCATION_TERM -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.runBlocking import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.AfterEach @@ -28,7 +27,6 @@ import org.springframework.test.context.ActiveProfiles import java.time.Instant import java.time.ZoneOffset -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest @ActiveProfiles("test") class AttributeServiceTests : WithTimescaleContainer, WithKafkaContainer { diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityEventServiceTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityEventServiceTests.kt index 061c8a34e..1dff12870 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityEventServiceTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityEventServiceTests.kt @@ -15,7 +15,6 @@ import com.egm.stellio.shared.web.DEFAULT_TENANT_URI import com.ninjasquad.springmockk.MockkBean import com.ninjasquad.springmockk.SpykBean import io.mockk.* -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Test import org.springframework.boot.test.context.SpringBootTest @@ -23,7 +22,6 @@ import org.springframework.kafka.core.KafkaTemplate import org.springframework.test.context.ActiveProfiles import java.util.concurrent.CompletableFuture -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = [EntityEventService::class]) @ActiveProfiles("test") class EntityEventServiceTests { diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityOperationServiceTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityOperationServiceTests.kt index df5985f15..fb0cc6bf6 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityOperationServiceTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityOperationServiceTests.kt @@ -19,7 +19,6 @@ import io.mockk.coEvery import io.mockk.coVerify import io.mockk.every import io.mockk.mockkClass -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertTrue @@ -29,7 +28,6 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest import org.springframework.test.context.ActiveProfiles -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = [EntityOperationService::class]) @ActiveProfiles("test") class EntityOperationServiceTests { diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityPayloadServiceTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityPayloadServiceTests.kt index 4fd42d6b1..c5e6b83ca 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityPayloadServiceTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityPayloadServiceTests.kt @@ -23,7 +23,6 @@ import com.egm.stellio.shared.util.JsonUtils.deserializeExpandedPayload import com.ninjasquad.springmockk.MockkBean import io.mockk.coEvery import io.mockk.coVerify -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatList @@ -38,7 +37,6 @@ import org.springframework.data.r2dbc.core.R2dbcEntityTemplate import org.springframework.test.context.ActiveProfiles import java.time.ZonedDateTime -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest @ActiveProfiles("test") class EntityPayloadServiceTests : WithTimescaleContainer, WithKafkaContainer { diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityQueryServiceTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityQueryServiceTests.kt index a7181a740..31355bc07 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityQueryServiceTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityQueryServiceTests.kt @@ -11,7 +11,6 @@ import com.egm.stellio.shared.util.* import com.egm.stellio.shared.util.JsonLdUtils.NGSILD_NAME_PROPERTY import com.ninjasquad.springmockk.MockkBean import io.mockk.coEvery -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.runBlocking import kotlinx.coroutines.test.runTest import org.assertj.core.api.Assertions.assertThat @@ -30,7 +29,6 @@ import org.springframework.data.relational.core.query.Update import org.springframework.test.context.ActiveProfiles import java.net.URI -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest @ActiveProfiles("test") class EntityQueryServiceTests : WithTimescaleContainer, WithKafkaContainer { diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityTypeServiceTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityTypeServiceTests.kt index fc2c0ad03..5e68807e3 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityTypeServiceTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/service/EntityTypeServiceTests.kt @@ -13,7 +13,6 @@ import com.egm.stellio.shared.model.ResourceNotFoundException import com.egm.stellio.shared.util.* import com.egm.stellio.shared.util.JsonLdUtils.NGSILD_LOCATION_PROPERTY import com.egm.stellio.shared.util.JsonLdUtils.NGSILD_LOCATION_TERM -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.runBlocking import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.AfterEach @@ -29,7 +28,6 @@ import org.springframework.test.context.ActiveProfiles import java.time.Instant import java.time.ZoneOffset -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest @ActiveProfiles("test") class EntityTypeServiceTests : WithTimescaleContainer, WithKafkaContainer { diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/service/TemporalEntityAttributeServiceTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/service/TemporalEntityAttributeServiceTests.kt index cd0746676..c46bb84cc 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/service/TemporalEntityAttributeServiceTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/service/TemporalEntityAttributeServiceTests.kt @@ -16,7 +16,6 @@ import com.ninjasquad.springmockk.MockkBean import com.ninjasquad.springmockk.SpykBean import io.mockk.coEvery import io.mockk.coVerify -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.Assertions.* @@ -33,7 +32,6 @@ import java.time.Instant import java.time.ZoneOffset.UTC import java.time.ZonedDateTime -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest @ActiveProfiles("test") class TemporalEntityAttributeServiceTests : WithTimescaleContainer, WithKafkaContainer { diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/util/AttributeInstanceUtilsTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/util/AttributeInstanceUtilsTests.kt index fa5b12821..ebe8938aa 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/util/AttributeInstanceUtilsTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/util/AttributeInstanceUtilsTests.kt @@ -3,7 +3,6 @@ package com.egm.stellio.search.util import com.egm.stellio.search.model.TemporalEntityAttribute import com.egm.stellio.shared.util.DEFAULT_CONTEXTS import com.egm.stellio.shared.util.JsonLdUtils.expandAttribute -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test @@ -11,7 +10,6 @@ import org.springframework.test.context.ActiveProfiles import java.net.URI import java.time.LocalTime -@OptIn(ExperimentalCoroutinesApi::class) @ActiveProfiles("test") class AttributeInstanceUtilsTests { diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/util/EntitiesQueryUtilsTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/util/EntitiesQueryUtilsTests.kt index d8fc25342..6027f7b76 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/util/EntitiesQueryUtilsTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/util/EntitiesQueryUtilsTests.kt @@ -11,7 +11,6 @@ import com.egm.stellio.shared.util.JsonLdUtils.NGSILD_DEFAULT_VOCAB import com.egm.stellio.shared.util.JsonLdUtils.NGSILD_OBSERVATION_SPACE_PROPERTY import io.mockk.every import io.mockk.mockkClass -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.Test @@ -20,7 +19,6 @@ import org.springframework.util.LinkedMultiValueMap import java.net.URI import java.time.ZonedDateTime -@OptIn(ExperimentalCoroutinesApi::class) @ActiveProfiles("test") class EntitiesQueryUtilsTests { diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/web/AnonymousUserHandlerTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/web/AnonymousUserHandlerTests.kt index 7dd146eb0..82eed369e 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/web/AnonymousUserHandlerTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/web/AnonymousUserHandlerTests.kt @@ -2,6 +2,7 @@ package com.egm.stellio.search.web import com.egm.stellio.search.authorization.AuthorizationService import com.egm.stellio.search.config.SearchProperties +import com.egm.stellio.search.config.WebSecurityTestConfig import com.egm.stellio.search.service.EntityEventService import com.egm.stellio.search.service.EntityPayloadService import com.egm.stellio.search.service.QueryService @@ -14,6 +15,7 @@ import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest +import org.springframework.context.annotation.Import import org.springframework.http.HttpHeaders import org.springframework.security.test.context.support.WithAnonymousUser import org.springframework.test.context.ActiveProfiles @@ -23,6 +25,7 @@ import org.springframework.test.web.reactive.server.WebTestClient @WebFluxTest(EntityHandler::class) @EnableConfigurationProperties(ApplicationProperties::class, SearchProperties::class) @Suppress("unused") +@Import(WebSecurityTestConfig::class) class AnonymousUserHandlerTests { private val aquacHeaderLink = buildContextLinkHeader(AQUAC_COMPOUND_CONTEXT) diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/web/AttributeHandlerTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/web/AttributeHandlerTests.kt index b2aed52c9..5e56e10fc 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/web/AttributeHandlerTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/web/AttributeHandlerTests.kt @@ -3,6 +3,7 @@ package com.egm.stellio.search.web import arrow.core.left import arrow.core.right import com.egm.stellio.search.config.SearchProperties +import com.egm.stellio.search.config.WebSecurityTestConfig import com.egm.stellio.search.model.AttributeDetails import com.egm.stellio.search.model.AttributeList import com.egm.stellio.search.model.AttributeType @@ -21,6 +22,7 @@ import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest +import org.springframework.context.annotation.Import import org.springframework.http.HttpHeaders import org.springframework.http.MediaType import org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.csrf @@ -31,6 +33,7 @@ import org.springframework.test.web.reactive.server.WebTestClient @ActiveProfiles("test") @WebFluxTest(AttributeHandler::class) @EnableConfigurationProperties(ApplicationProperties::class, SearchProperties::class) +@Import(WebSecurityTestConfig::class) class AttributeHandlerTests { @Autowired diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/web/EntityAccessControlHandlerTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/web/EntityAccessControlHandlerTests.kt index 7ad3e3841..92f195f6c 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/web/EntityAccessControlHandlerTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/web/EntityAccessControlHandlerTests.kt @@ -7,6 +7,7 @@ import com.egm.stellio.search.authorization.EntityAccessRights import com.egm.stellio.search.authorization.EntityAccessRightsService import com.egm.stellio.search.authorization.User import com.egm.stellio.search.config.SearchProperties +import com.egm.stellio.search.config.WebSecurityTestConfig import com.egm.stellio.search.service.EntityPayloadService import com.egm.stellio.shared.config.ApplicationProperties import com.egm.stellio.shared.model.* @@ -34,13 +35,13 @@ import com.ninjasquad.springmockk.MockkBean import io.mockk.Called import io.mockk.coEvery import io.mockk.coVerify -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.BeforeAll import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest +import org.springframework.context.annotation.Import import org.springframework.http.HttpHeaders import org.springframework.http.HttpStatus import org.springframework.http.MediaType @@ -51,10 +52,10 @@ import org.springframework.test.web.reactive.server.WebTestClient import java.net.URI import java.time.Duration -@OptIn(ExperimentalCoroutinesApi::class) @ActiveProfiles("test") @WebFluxTest(EntityAccessControlHandler::class) @EnableConfigurationProperties(ApplicationProperties::class, SearchProperties::class) +@Import(WebSecurityTestConfig::class) class EntityAccessControlHandlerTests { private val authzHeaderLink = buildContextLinkHeader(AUTHORIZATION_CONTEXT) diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/web/EntityHandlerTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/web/EntityHandlerTests.kt index 403a545a4..ee690c6e7 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/web/EntityHandlerTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/web/EntityHandlerTests.kt @@ -4,6 +4,7 @@ import arrow.core.left import arrow.core.right import com.egm.stellio.search.authorization.AuthorizationService import com.egm.stellio.search.config.SearchProperties +import com.egm.stellio.search.config.WebSecurityTestConfig import com.egm.stellio.search.model.* import com.egm.stellio.search.service.EntityEventService import com.egm.stellio.search.service.EntityPayloadService @@ -34,6 +35,7 @@ import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest +import org.springframework.context.annotation.Import import org.springframework.core.io.ClassPathResource import org.springframework.http.HttpHeaders import org.springframework.http.HttpMethod @@ -50,6 +52,7 @@ import java.time.* @ActiveProfiles("test") @WebFluxTest(EntityHandler::class) @EnableConfigurationProperties(ApplicationProperties::class, SearchProperties::class) +@Import(WebSecurityTestConfig::class) class EntityHandlerTests { private val aquacHeaderLink = buildContextLinkHeader(AQUAC_COMPOUND_CONTEXT) diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/web/EntityOperationHandlerTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/web/EntityOperationHandlerTests.kt index 2359225eb..4a19fc35f 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/web/EntityOperationHandlerTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/web/EntityOperationHandlerTests.kt @@ -4,6 +4,7 @@ import arrow.core.left import arrow.core.right import com.egm.stellio.search.authorization.AuthorizationService import com.egm.stellio.search.config.SearchProperties +import com.egm.stellio.search.config.WebSecurityTestConfig import com.egm.stellio.search.model.EMPTY_UPDATE_RESULT import com.egm.stellio.search.model.EntityPayload import com.egm.stellio.search.model.UpdateResult @@ -19,7 +20,6 @@ import com.egm.stellio.shared.util.* import com.egm.stellio.shared.util.JsonLdUtils.NGSILD_DEFAULT_VOCAB import com.ninjasquad.springmockk.MockkBean import io.mockk.* -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.Job import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Assertions.assertEquals @@ -31,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest +import org.springframework.context.annotation.Import import org.springframework.core.io.ClassPathResource import org.springframework.http.HttpStatus import org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.csrf @@ -39,11 +40,11 @@ import org.springframework.test.context.ActiveProfiles import org.springframework.test.web.reactive.server.WebTestClient import java.net.URI -@OptIn(ExperimentalCoroutinesApi::class) @AutoConfigureWebTestClient(timeout = "30000") @ActiveProfiles("test") @WebFluxTest(EntityOperationHandler::class) @EnableConfigurationProperties(ApplicationProperties::class, SearchProperties::class) +@Import(WebSecurityTestConfig::class) class EntityOperationHandlerTests { @Autowired diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/web/EntityTypeHandlerTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/web/EntityTypeHandlerTests.kt index 95d263a76..2847bae64 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/web/EntityTypeHandlerTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/web/EntityTypeHandlerTests.kt @@ -3,6 +3,7 @@ package com.egm.stellio.search.web import arrow.core.left import arrow.core.right import com.egm.stellio.search.config.SearchProperties +import com.egm.stellio.search.config.WebSecurityTestConfig import com.egm.stellio.search.model.* import com.egm.stellio.search.model.AttributeType import com.egm.stellio.search.service.EntityTypeService @@ -19,6 +20,7 @@ import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest +import org.springframework.context.annotation.Import import org.springframework.http.HttpHeaders import org.springframework.http.MediaType import org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.csrf @@ -29,6 +31,7 @@ import org.springframework.test.web.reactive.server.WebTestClient @ActiveProfiles("test") @WebFluxTest(EntityTypeHandler::class) @EnableConfigurationProperties(ApplicationProperties::class, SearchProperties::class) +@Import(WebSecurityTestConfig::class) class EntityTypeHandlerTests { @Autowired diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/web/TemporalEntityHandlerTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/web/TemporalEntityHandlerTests.kt index 4e494bb5c..acc3c2d21 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/web/TemporalEntityHandlerTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/web/TemporalEntityHandlerTests.kt @@ -6,6 +6,7 @@ import arrow.core.left import arrow.core.right import com.egm.stellio.search.authorization.AuthorizationService import com.egm.stellio.search.config.SearchProperties +import com.egm.stellio.search.config.WebSecurityTestConfig import com.egm.stellio.search.model.SimplifiedAttributeInstanceResult import com.egm.stellio.search.model.TemporalEntityAttribute import com.egm.stellio.search.model.TemporalQuery @@ -28,7 +29,6 @@ import io.mockk.Called import io.mockk.coEvery import io.mockk.coVerify import io.mockk.confirmVerified -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.hamcrest.core.Is import org.junit.jupiter.api.BeforeAll @@ -36,6 +36,7 @@ import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest +import org.springframework.context.annotation.Import import org.springframework.core.io.ClassPathResource import org.springframework.http.HttpHeaders import org.springframework.http.HttpMethod @@ -50,10 +51,10 @@ import java.time.ZoneOffset import java.time.ZonedDateTime import java.util.UUID -@OptIn(ExperimentalCoroutinesApi::class) @ActiveProfiles("test") @WebFluxTest(TemporalEntityHandler::class) @EnableConfigurationProperties(ApplicationProperties::class, SearchProperties::class) +@Import(WebSecurityTestConfig::class) class TemporalEntityHandlerTests { private lateinit var apicHeaderLink: String diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/web/TemporalEntityOperationsHandlerTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/web/TemporalEntityOperationsHandlerTests.kt index 18589d8d0..d853c43e3 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/web/TemporalEntityOperationsHandlerTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/web/TemporalEntityOperationsHandlerTests.kt @@ -3,6 +3,7 @@ package com.egm.stellio.search.web import arrow.core.Either import com.egm.stellio.search.authorization.AuthorizationService import com.egm.stellio.search.config.SearchProperties +import com.egm.stellio.search.config.WebSecurityTestConfig import com.egm.stellio.search.model.TemporalQuery import com.egm.stellio.search.service.QueryService import com.egm.stellio.shared.config.ApplicationProperties @@ -16,6 +17,7 @@ import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest +import org.springframework.context.annotation.Import import org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.csrf import org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.mockJwt import org.springframework.test.context.ActiveProfiles @@ -25,6 +27,7 @@ import java.time.ZonedDateTime @ActiveProfiles("test") @WebFluxTest(TemporalEntityOperationsHandler::class) @EnableConfigurationProperties(ApplicationProperties::class, SearchProperties::class) +@Import(WebSecurityTestConfig::class) class TemporalEntityOperationsHandlerTests { private lateinit var apicHeaderLink: String diff --git a/search-service/src/test/kotlin/db/migration/V0_29_JsonLd_migrationTests.kt b/search-service/src/test/kotlin/db/migration/V0_29_JsonLd_migrationTests.kt index 22a0c4c2f..645011f5e 100644 --- a/search-service/src/test/kotlin/db/migration/V0_29_JsonLd_migrationTests.kt +++ b/search-service/src/test/kotlin/db/migration/V0_29_JsonLd_migrationTests.kt @@ -4,13 +4,11 @@ import com.egm.stellio.shared.util.APIC_COMPOUND_CONTEXT import com.egm.stellio.shared.util.JsonLdUtils import com.egm.stellio.shared.util.JsonUtils.deserializeAsMap import com.egm.stellio.shared.util.loadSampleData -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import org.springframework.test.context.ActiveProfiles -@OptIn(ExperimentalCoroutinesApi::class) @ActiveProfiles("test") class V0_29_JsonLd_migrationTests { diff --git a/shared/src/test/kotlin/com/egm/stellio/shared/model/JsonLdEntityTests.kt b/shared/src/test/kotlin/com/egm/stellio/shared/model/JsonLdEntityTests.kt index 5021a4c27..a2a3a283a 100644 --- a/shared/src/test/kotlin/com/egm/stellio/shared/model/JsonLdEntityTests.kt +++ b/shared/src/test/kotlin/com/egm/stellio/shared/model/JsonLdEntityTests.kt @@ -7,7 +7,6 @@ import com.egm.stellio.shared.util.JsonLdUtils.NGSILD_LOCATION_TERM import com.egm.stellio.shared.util.JsonLdUtils.NGSILD_NAME_PROPERTY import com.egm.stellio.shared.util.JsonLdUtils.expandJsonLdEntity import com.egm.stellio.shared.util.JsonUtils.deserializeAsMap -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Assertions.assertEquals @@ -15,7 +14,6 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.api.fail import org.springframework.http.MediaType -@OptIn(ExperimentalCoroutinesApi::class) class JsonLdEntityTests { private val normalizedJson = diff --git a/shared/src/test/kotlin/com/egm/stellio/shared/model/NgsiLdEntityTests.kt b/shared/src/test/kotlin/com/egm/stellio/shared/model/NgsiLdEntityTests.kt index 93c98642b..2bb23bf72 100644 --- a/shared/src/test/kotlin/com/egm/stellio/shared/model/NgsiLdEntityTests.kt +++ b/shared/src/test/kotlin/com/egm/stellio/shared/model/NgsiLdEntityTests.kt @@ -8,13 +8,11 @@ import com.egm.stellio.shared.util.JsonLdUtils.expandJsonLdEntity import com.egm.stellio.shared.util.shouldFail import com.egm.stellio.shared.util.shouldSucceedAndResult import com.egm.stellio.shared.util.toUri -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.Test import java.time.ZonedDateTime -@OptIn(ExperimentalCoroutinesApi::class) class NgsiLdEntityTests { @Test diff --git a/shared/src/test/kotlin/com/egm/stellio/shared/util/ApiUtilsTests.kt b/shared/src/test/kotlin/com/egm/stellio/shared/util/ApiUtilsTests.kt index 2785a8c78..d734bd0ac 100644 --- a/shared/src/test/kotlin/com/egm/stellio/shared/util/ApiUtilsTests.kt +++ b/shared/src/test/kotlin/com/egm/stellio/shared/util/ApiUtilsTests.kt @@ -4,7 +4,6 @@ import com.egm.stellio.shared.model.BadRequestDataException import com.egm.stellio.shared.util.JsonLdUtils.NGSILD_CORE_CONTEXT import com.egm.stellio.shared.util.OptionsParamValue.TEMPORAL_VALUES import com.egm.stellio.shared.web.CustomWebFilter -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.Test @@ -15,7 +14,6 @@ import org.springframework.test.context.ActiveProfiles import org.springframework.test.web.reactive.server.WebTestClient import java.util.Optional -@OptIn(ExperimentalCoroutinesApi::class) @ActiveProfiles("test") class ApiUtilsTests { private val webClient = WebTestClient.bindToController(MockkedHandler()).webFilter( diff --git a/shared/src/test/kotlin/com/egm/stellio/shared/util/DataRepresentationUtilsTests.kt b/shared/src/test/kotlin/com/egm/stellio/shared/util/DataRepresentationUtilsTests.kt index 9157c7345..990a06f4a 100644 --- a/shared/src/test/kotlin/com/egm/stellio/shared/util/DataRepresentationUtilsTests.kt +++ b/shared/src/test/kotlin/com/egm/stellio/shared/util/DataRepresentationUtilsTests.kt @@ -2,7 +2,6 @@ package com.egm.stellio.shared.util import com.egm.stellio.shared.model.BadRequestDataException import com.egm.stellio.shared.util.JsonUtils.deserializeAsMap -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertInstanceOf @@ -10,7 +9,6 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.CsvSource -@OptIn(ExperimentalCoroutinesApi::class) class DataRepresentationUtilsTests { @Test diff --git a/shared/src/test/kotlin/com/egm/stellio/shared/util/GeoQueryUtilsTests.kt b/shared/src/test/kotlin/com/egm/stellio/shared/util/GeoQueryUtilsTests.kt index 68b743eea..3426ad86f 100644 --- a/shared/src/test/kotlin/com/egm/stellio/shared/util/GeoQueryUtilsTests.kt +++ b/shared/src/test/kotlin/com/egm/stellio/shared/util/GeoQueryUtilsTests.kt @@ -6,14 +6,12 @@ import com.egm.stellio.shared.model.GeoQuery.GeometryType import com.egm.stellio.shared.util.JsonLdUtils.NGSILD_CORE_CONTEXT import com.egm.stellio.shared.util.JsonLdUtils.NGSILD_LOCATION_PROPERTY import com.egm.stellio.shared.util.JsonLdUtils.NGSILD_OPERATION_SPACE_PROPERTY -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertInstanceOf import org.junit.jupiter.api.Test import org.springframework.test.context.ActiveProfiles -@OptIn(ExperimentalCoroutinesApi::class) @ActiveProfiles("test") class GeoQueryUtilsTests { diff --git a/shared/src/test/kotlin/com/egm/stellio/shared/util/JsonLdUtilsTests.kt b/shared/src/test/kotlin/com/egm/stellio/shared/util/JsonLdUtilsTests.kt index a7742f756..35fc29ce3 100644 --- a/shared/src/test/kotlin/com/egm/stellio/shared/util/JsonLdUtilsTests.kt +++ b/shared/src/test/kotlin/com/egm/stellio/shared/util/JsonLdUtilsTests.kt @@ -14,14 +14,12 @@ import com.egm.stellio.shared.util.JsonLdUtils.extractContextFromInput import com.egm.stellio.shared.util.JsonLdUtils.extractRelationshipObject import com.egm.stellio.shared.util.JsonLdUtils.getAttributeFromExpandedAttributes import com.egm.stellio.shared.util.JsonUtils.deserializeAsMap -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.springframework.http.MediaType -@OptIn(ExperimentalCoroutinesApi::class) class JsonLdUtilsTests { private val normalizedJson = diff --git a/shared/src/test/kotlin/com/egm/stellio/shared/util/JsonUtilsTests.kt b/shared/src/test/kotlin/com/egm/stellio/shared/util/JsonUtilsTests.kt index 49ae03062..ae61a4fc0 100644 --- a/shared/src/test/kotlin/com/egm/stellio/shared/util/JsonUtilsTests.kt +++ b/shared/src/test/kotlin/com/egm/stellio/shared/util/JsonUtilsTests.kt @@ -6,13 +6,11 @@ import com.egm.stellio.shared.util.JsonUtils.deserializeAs import com.egm.stellio.shared.util.JsonUtils.deserializeAsMap import com.egm.stellio.shared.util.JsonUtils.serializeObject import com.egm.stellio.shared.web.DEFAULT_TENANT_URI -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows -@OptIn(ExperimentalCoroutinesApi::class) class JsonUtilsTests { private val entityId = "urn:ngsi-ld:BeeHive:01".toUri() diff --git a/subscription-service/src/test/kotlin/com/egm/stellio/subscription/job/TimeIntervalNotificationJobTest.kt b/subscription-service/src/test/kotlin/com/egm/stellio/subscription/job/TimeIntervalNotificationJobTest.kt index ad061c249..d62bb96c6 100644 --- a/subscription-service/src/test/kotlin/com/egm/stellio/subscription/job/TimeIntervalNotificationJobTest.kt +++ b/subscription-service/src/test/kotlin/com/egm/stellio/subscription/job/TimeIntervalNotificationJobTest.kt @@ -20,7 +20,6 @@ import com.github.tomakehurst.wiremock.client.WireMock.* import com.github.tomakehurst.wiremock.junit5.WireMockTest import com.ninjasquad.springmockk.MockkBean import io.mockk.* -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.runBlocking import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Assertions.assertEquals @@ -32,7 +31,6 @@ import org.springframework.context.annotation.Import import org.springframework.test.context.ActiveProfiles import org.springframework.test.context.TestPropertySource -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = [TimeIntervalNotificationJob::class]) @WireMockTest(httpPort = 8089) @Import(WebClientConfig::class) diff --git a/subscription-service/src/test/kotlin/com/egm/stellio/subscription/listener/EntityEventListenerServiceTests.kt b/subscription-service/src/test/kotlin/com/egm/stellio/subscription/listener/EntityEventListenerServiceTests.kt index dbcf98709..65b59272e 100644 --- a/subscription-service/src/test/kotlin/com/egm/stellio/subscription/listener/EntityEventListenerServiceTests.kt +++ b/subscription-service/src/test/kotlin/com/egm/stellio/subscription/listener/EntityEventListenerServiceTests.kt @@ -12,14 +12,12 @@ import io.mockk.coEvery import io.mockk.coVerify import io.mockk.confirmVerified import io.mockk.mockkClass -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest import org.springframework.test.context.ActiveProfiles -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = [EntityEventListenerService::class]) @ActiveProfiles("test") class EntityEventListenerServiceTests { diff --git a/subscription-service/src/test/kotlin/com/egm/stellio/subscription/service/NotificationServiceTests.kt b/subscription-service/src/test/kotlin/com/egm/stellio/subscription/service/NotificationServiceTests.kt index e42b84926..781007114 100644 --- a/subscription-service/src/test/kotlin/com/egm/stellio/subscription/service/NotificationServiceTests.kt +++ b/subscription-service/src/test/kotlin/com/egm/stellio/subscription/service/NotificationServiceTests.kt @@ -22,7 +22,6 @@ import com.ninjasquad.springmockk.MockkBean import io.mockk.coEvery import io.mockk.coVerify import io.mockk.confirmVerified -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.reactor.awaitSingle import kotlinx.coroutines.reactor.mono import kotlinx.coroutines.test.runTest @@ -34,7 +33,6 @@ import org.springframework.boot.test.context.SpringBootTest import org.springframework.http.HttpHeaders import org.springframework.test.context.ActiveProfiles -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = [NotificationService::class]) @WireMockTest(httpPort = 8089) @ActiveProfiles("test") diff --git a/subscription-service/src/test/kotlin/com/egm/stellio/subscription/service/SubscriptionServiceTests.kt b/subscription-service/src/test/kotlin/com/egm/stellio/subscription/service/SubscriptionServiceTests.kt index ef8a9edbf..637ef3b76 100644 --- a/subscription-service/src/test/kotlin/com/egm/stellio/subscription/service/SubscriptionServiceTests.kt +++ b/subscription-service/src/test/kotlin/com/egm/stellio/subscription/service/SubscriptionServiceTests.kt @@ -21,7 +21,6 @@ import com.egm.stellio.subscription.support.WithTimescaleContainer import com.egm.stellio.subscription.utils.ParsingUtils import com.egm.stellio.subscription.utils.gimmeSubscriptionFromMembers import com.egm.stellio.subscription.utils.loadAndDeserializeSubscription -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.delay import kotlinx.coroutines.runBlocking import kotlinx.coroutines.test.runTest @@ -43,7 +42,6 @@ import java.time.ZonedDateTime import java.util.UUID import kotlin.time.Duration -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest @ActiveProfiles("test") @TestPropertySource(properties = ["application.authentication.enabled=false"]) diff --git a/subscription-service/src/test/kotlin/com/egm/stellio/subscription/utils/ParsingUtilsTests.kt b/subscription-service/src/test/kotlin/com/egm/stellio/subscription/utils/ParsingUtilsTests.kt index 63ffe5d04..1ce8e3765 100644 --- a/subscription-service/src/test/kotlin/com/egm/stellio/subscription/utils/ParsingUtilsTests.kt +++ b/subscription-service/src/test/kotlin/com/egm/stellio/subscription/utils/ParsingUtilsTests.kt @@ -6,7 +6,6 @@ import com.egm.stellio.shared.util.JsonLdUtils.NGSILD_SUBSCRIPTION_TERM import com.egm.stellio.shared.util.shouldSucceedWith import com.egm.stellio.shared.util.toUri import com.egm.stellio.subscription.model.EndpointInfo -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.Test @@ -14,7 +13,6 @@ import org.junit.jupiter.api.fail import org.springframework.boot.test.context.SpringBootTest import org.springframework.test.context.ActiveProfiles -@OptIn(ExperimentalCoroutinesApi::class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = [ParsingUtils::class]) @ActiveProfiles("test") class ParsingUtilsTests { diff --git a/subscription-service/src/test/kotlin/com/egm/stellio/subscription/web/SubscriptionHandlerTests.kt b/subscription-service/src/test/kotlin/com/egm/stellio/subscription/web/SubscriptionHandlerTests.kt index 723b5ea82..060b66824 100644 --- a/subscription-service/src/test/kotlin/com/egm/stellio/subscription/web/SubscriptionHandlerTests.kt +++ b/subscription-service/src/test/kotlin/com/egm/stellio/subscription/web/SubscriptionHandlerTests.kt @@ -15,7 +15,6 @@ import io.mockk.Called import io.mockk.coEvery import io.mockk.coVerify import io.mockk.confirmVerified -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest import org.hamcrest.core.Is import org.junit.jupiter.api.BeforeAll @@ -32,7 +31,6 @@ import org.springframework.security.test.web.reactive.server.SecurityMockServerC import org.springframework.test.context.ActiveProfiles import org.springframework.test.web.reactive.server.WebTestClient -@OptIn(ExperimentalCoroutinesApi::class) @AutoConfigureWebTestClient(timeout = "30000") @ActiveProfiles("test") @WebFluxTest(SubscriptionHandler::class) From bff1a735fcb957897c245892efec6547625600f6 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Fri, 1 Dec 2023 08:12:19 +0100 Subject: [PATCH 5/9] conf: run Jenkins pipeline on Java 21 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 54be3cf45..35fc704da 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,7 @@ pipeline { agent any tools { - jdk 'JDK 17' + jdk 'JDK 21' } environment { EGM_CI_DH = credentials('egm-ci-dh') From 1580be8e95525455398d8620f0181e6fd70ff4fb Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 2 Dec 2023 13:46:35 +0100 Subject: [PATCH 6/9] feat: update base Docker image to Java 21 --- build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 0d9905264..c09a8a076 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -139,7 +139,7 @@ subprojects { } } - project.ext.set("jibFromImage", "eclipse-temurin:17-jre") + project.ext.set("jibFromImage", "eclipse-temurin:21-jre") project.ext.set( "jibFromPlatforms", listOf( @@ -163,7 +163,7 @@ subprojects { NGSI-LD is an Open API and data model specification for context management published by ETSI. """.trimIndent(), "org.opencontainers.image.source" to "https://github.com/stellio-hub/stellio-context-broker", - "com.java.version" to "${JavaVersion.VERSION_17}" + "com.java.version" to "${JavaVersion.VERSION_21}" ) ) } From 172b3cd896339db29967b874790a6c622718ae95 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 3 Dec 2023 07:43:32 +0100 Subject: [PATCH 7/9] chore: bump detekt to 1.23.4 --- api-gateway/build.gradle.kts | 2 +- search-service/build.gradle.kts | 2 +- shared/build.gradle.kts | 2 +- subscription-service/build.gradle.kts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api-gateway/build.gradle.kts b/api-gateway/build.gradle.kts index c559fed4f..c6d41f1d0 100644 --- a/api-gateway/build.gradle.kts +++ b/api-gateway/build.gradle.kts @@ -9,7 +9,7 @@ dependencies { implementation("org.springframework.cloud:spring-cloud-starter-gateway") implementation("org.zalando:logbook-spring-boot-webflux-autoconfigure:3.6.0") - detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.3") + detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.4") } springBoot { diff --git a/search-service/build.gradle.kts b/search-service/build.gradle.kts index 52f1e8d92..cc7b3a0b7 100644 --- a/search-service/build.gradle.kts +++ b/search-service/build.gradle.kts @@ -23,7 +23,7 @@ dependencies { implementation("org.json:json:20231013") implementation(project(":shared")) - detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.3") + detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.4") developmentOnly("org.springframework.boot:spring-boot-devtools") diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index fc91ba502..2d0bc67bb 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -28,7 +28,7 @@ dependencies { exclude(module = "mockito-core") } - detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.3") + detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.4") testFixturesApi("org.testcontainers:testcontainers") testFixturesApi("org.testcontainers:junit-jupiter") diff --git a/subscription-service/build.gradle.kts b/subscription-service/build.gradle.kts index 08057ad3d..2f540959f 100644 --- a/subscription-service/build.gradle.kts +++ b/subscription-service/build.gradle.kts @@ -21,7 +21,7 @@ dependencies { implementation("com.jayway.jsonpath:json-path:2.8.0") implementation(project(":shared")) - detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.3") + detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.4") developmentOnly("org.springframework.boot:spring-boot-devtools") From 04021d22f22eec627b7cd9462b68a7680d1a8650 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Thu, 14 Dec 2023 21:28:06 +0100 Subject: [PATCH 8/9] chore(api-gateway): fix Gradle deprecation warning --- api-gateway/build.gradle.kts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api-gateway/build.gradle.kts b/api-gateway/build.gradle.kts index c6d41f1d0..217fad79f 100644 --- a/api-gateway/build.gradle.kts +++ b/api-gateway/build.gradle.kts @@ -9,6 +9,10 @@ dependencies { implementation("org.springframework.cloud:spring-cloud-starter-gateway") implementation("org.zalando:logbook-spring-boot-webflux-autoconfigure:3.6.0") + // https://docs.gradle.org/8.4/userguide/upgrading_version_8.html#test_framework_implementation_dependencies + testImplementation("org.springframework.boot:spring-boot-starter-test") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") + detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.4") } From 383bd401b950ce295d216571b39a17d96dbc5a3d Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Thu, 14 Dec 2023 21:34:32 +0100 Subject: [PATCH 9/9] chore: update base Dockerfiles to Java 21 --- README.md | 2 +- api-gateway/Dockerfile | 4 ++-- search-service/Dockerfile | 4 ++-- subscription-service/Dockerfile | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index aebba3fc5..9c212fb81 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ The version number is obtained during the build process by using the `version` i ### Developing on a service Requirements: -* Java 17 (we recommend using [sdkman!](https://sdkman.io/) to install and manage versions of the JDK) +* Java 21 (we recommend using [sdkman!](https://sdkman.io/) to install and manage versions of the JDK) To develop on a specific service, you can use the provided `docker-compose.yml` file inside each service's directory, for instance: diff --git a/api-gateway/Dockerfile b/api-gateway/Dockerfile index 9489adb55..b0ca8a5d4 100644 --- a/api-gateway/Dockerfile +++ b/api-gateway/Dockerfile @@ -1,12 +1,12 @@ # You can build a Docker image of the module with the following command: # docker build --build-arg JAR_FILE=build/libs/api-gateway-{version}.jar -t stellio-api-gateway:{version} . -FROM eclipse-temurin:17-jre as builder +FROM eclipse-temurin:21-jre as builder WORKDIR application ARG JAR_FILE=build/libs/*.jar COPY ${JAR_FILE} application.jar RUN java -Djarmode=layertools -jar application.jar extract -FROM eclipse-temurin:17-jre +FROM eclipse-temurin:21-jre WORKDIR application COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ diff --git a/search-service/Dockerfile b/search-service/Dockerfile index 0e4c15d6b..5a2770219 100644 --- a/search-service/Dockerfile +++ b/search-service/Dockerfile @@ -1,12 +1,12 @@ # You can build a Docker image of the module with the following command: # docker build --build-arg JAR_FILE=build/libs/search-service-{version}.jar -t stellio-search-service:{version} . -FROM eclipse-temurin:17-jre as builder +FROM eclipse-temurin:21-jre as builder WORKDIR application ARG JAR_FILE=build/libs/*.jar COPY ${JAR_FILE} application.jar RUN java -Djarmode=layertools -jar application.jar extract -FROM eclipse-temurin:17-jre +FROM eclipse-temurin:21-jre WORKDIR application COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./ diff --git a/subscription-service/Dockerfile b/subscription-service/Dockerfile index b0b229a42..5f41d609b 100644 --- a/subscription-service/Dockerfile +++ b/subscription-service/Dockerfile @@ -1,12 +1,12 @@ # You can build a Docker image of the module with the following command: # docker build --build-arg JAR_FILE=build/libs/subscription-service-{version}.jar -t stellio-subscription-service:{version} . -FROM eclipse-temurin:17-jre as builder +FROM eclipse-temurin:21-jre as builder WORKDIR application ARG JAR_FILE=build/libs/*.jar COPY ${JAR_FILE} application.jar RUN java -Djarmode=layertools -jar application.jar extract -FROM eclipse-temurin:17-jre +FROM eclipse-temurin:21-jre WORKDIR application COPY --from=builder application/dependencies/ ./ COPY --from=builder application/spring-boot-loader/ ./