diff --git a/.dockerignore b/.dockerignore index 149bf854..29e4ff90 100644 --- a/.dockerignore +++ b/.dockerignore @@ -117,4 +117,5 @@ renovate.json ### User template db/ +release/ README.md diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7f70ef92..00955e8b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -18,7 +18,7 @@ jobs: name: Lint Dockerfile runs-on: ubuntu-latest steps: - - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - uses: hadolint/hadolint-action@2332a7b74a6de0dda2e2221d575162eba76ba5e5 # v3.3.0 build: @@ -31,7 +31,7 @@ jobs: id-token: write security-events: write steps: - - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 with: registry: ghcr.io @@ -39,7 +39,7 @@ jobs: password: ${{ github.token }} - uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0 - uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 - - uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 # v5.9.0 + - uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0 id: meta env: DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index @@ -57,7 +57,7 @@ jobs: # on.push.branch: branchName # on.pull_request: pr-number (won't be pushed) - - uses: docker/bake-action@3acf805d94d93a86cce4ca44798a76464a75b88c # v6.9.0 + - uses: docker/bake-action@5be5f02ff8819ecd3092ea6b2e6261c31774f2b4 # v6.10.0 with: push: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }} files: | @@ -70,7 +70,7 @@ jobs: *.cache-from=type=gha *.cache-to=type=gha,mode=max - - uses: anchore/scan-action@3aaf50d765cfcceafa51d322ccb790e40f6cd8c5 # v7.2.0 + - uses: anchore/scan-action@40a61b52209e9d50e87917c5b901783d546b12d0 # v7.2.1 id: scan if: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }} with: @@ -79,7 +79,7 @@ jobs: severity-cutoff: 'high' fail-build: false - - uses: github/codeql-action/upload-sarif@fdbfb4d2750291e159f0156def62b853c2798ca2 # v4.31.5 + - uses: github/codeql-action/upload-sarif@fe4161a26a8629af62121b670040955b330f9af2 # v4.31.6 if: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }} with: sarif_file: ${{ steps.scan.outputs.sarif }} diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 4630d210..e9784425 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -18,7 +18,7 @@ jobs: permissions: id-token: write # for codecov steps: - - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: fetch-depth: '0' # to allow sonar to attach git blame information - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 @@ -43,7 +43,7 @@ jobs: runs-on: ubuntu-22.04-arm name: "Integration test" steps: - - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 with: distribution: "liberica" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0035aa54..684b5377 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,22 +22,26 @@ jobs: permission-issues: write # to be able to comment on released issues permission-pull-requests: write # to be able to comment on released pull requests - - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: token: ${{ steps.release-token.outputs.token }} fetch-depth: 0 - # persist-credentials: 'false' + sparse-checkout: release - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 + with: + package_json_file: 'release/package.json' - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 with: - node-version-file: package.json + node-version-file: 'release/.nvmrc' cache: 'pnpm' - cache-dependency-path: 'pnpm-lock.yaml' + cache-dependency-path: 'release/pnpm-lock.yaml' - - run: pnpm install + - run: pnpm install --frozen-lockfile + working-directory: release - run: pnpm run release + working-directory: release env: GH_TOKEN: ${{ steps.release-token.outputs.token }} diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 43642077..18e05de8 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -31,7 +31,7 @@ jobs: permission-issues: write # to be able to comment on released issues permission-pull-requests: write # to be able to comment on released pull requests - - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: false @@ -51,6 +51,6 @@ jobs: path: results.sarif retention-days: 5 - - uses: github/codeql-action/upload-sarif@fdbfb4d2750291e159f0156def62b853c2798ca2 # v4.31.5 + - uses: github/codeql-action/upload-sarif@fe4161a26a8629af62121b670040955b330f9af2 # v4.31.6 with: sarif_file: results.sarif diff --git a/.gitignore b/.gitignore index 3ab5f9a7..8ee6accb 100644 --- a/.gitignore +++ b/.gitignore @@ -102,9 +102,6 @@ gradle-app.setting # JDT-specific (Eclipse Java Development Tools) .classpath -### Node template -node_modules - ### User template # Ignore local application profiles diff --git a/.releaserc.json b/.releaserc.json deleted file mode 100644 index 6eb5e309..00000000 --- a/.releaserc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "$schema": "https://www.schemastore.org/semantic-release.json", - "plugins": [ - "@semantic-release/commit-analyzer", - "@semantic-release/release-notes-generator", - "@semantic-release/github" - ] -} diff --git a/Dockerfile b/Dockerfile index 16608503..5240763f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM bellsoft/liberica-runtime-container:jdk-21.0.9_11-cds-musl@sha256:f061c5bdaae96640563262985c50f6fb5ed8fce17522e5979440019169c6774e AS build +FROM bellsoft/liberica-runtime-container:jdk-21.0.9_11-cds-musl@sha256:47a25e6813844f43cdb9569e5823bff4a09e310191abd5442e098a5c14d2c019 AS build WORKDIR /usr/src/app # cache dependencies COPY ./buildSrc/*.gradle.kts ./buildSrc/ @@ -26,7 +26,7 @@ ARG BUILD_ARG="bootJar" RUN --mount=type=cache,target=/root/.gradle \ ./gradlew ${BUILD_ARG} -FROM bellsoft/liberica-runtime-container:jre-25-cds-musl@sha256:c608a522fbd0937733e5d97f9b4749e76955fa56087707a48e90bf30ff31d132 AS app +FROM bellsoft/liberica-runtime-container:jre-25-cds-musl@sha256:00847b4d088bb32cb4ac1b3717d82f314a70bcff4ea7657761fe99370872bf19 AS app # use non-root user RUN addgroup -S spring && adduser -S spring -G spring USER spring:spring diff --git a/buildSrc/src/main/kotlin/hu/bsstudio/gradle/DependencyManagementPlugin.kt b/buildSrc/src/main/kotlin/hu/bsstudio/gradle/DependencyManagementPlugin.kt index 41f30d5f..0e684c11 100644 --- a/buildSrc/src/main/kotlin/hu/bsstudio/gradle/DependencyManagementPlugin.kt +++ b/buildSrc/src/main/kotlin/hu/bsstudio/gradle/DependencyManagementPlugin.kt @@ -13,7 +13,7 @@ class DependencyManagementPlugin : Plugin { project.dependencies { add("implementation", platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)) - add("implementation", platform("org.springframework.cloud:spring-cloud-dependencies:2025.0.0")) + add("implementation", platform("org.springframework.cloud:spring-cloud-dependencies:2025.1.0")) } } } diff --git a/buildSrc/src/main/kotlin/hu/bsstudio/gradle/IntegrationTestConventionPlugin.kt b/buildSrc/src/main/kotlin/hu/bsstudio/gradle/IntegrationTestConventionPlugin.kt index a0ac6917..e7216a78 100644 --- a/buildSrc/src/main/kotlin/hu/bsstudio/gradle/IntegrationTestConventionPlugin.kt +++ b/buildSrc/src/main/kotlin/hu/bsstudio/gradle/IntegrationTestConventionPlugin.kt @@ -16,8 +16,6 @@ class IntegrationTestConventionPlugin : Plugin { register("integrationTest") { useJUnitJupiter() dependencies { - implementation(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)) - implementation(platform("org.springframework.cloud:spring-cloud-dependencies:2025.0.0")) implementation("org.springframework.boot:spring-boot-starter-test") { exclude(group = "org.hamcrest") exclude(group = "org.assertj") @@ -30,5 +28,9 @@ class IntegrationTestConventionPlugin : Plugin { } } } + project.configurations.named("integrationTestImplementation") { + extendsFrom(project.configurations.getByName("implementation")) + extendsFrom(project.configurations.getByName("runtimeOnly")) + } } } diff --git a/buildSrc/src/main/kotlin/hu/bsstudio/gradle/SpringAppConventionPlugin.kt b/buildSrc/src/main/kotlin/hu/bsstudio/gradle/SpringAppConventionPlugin.kt index 83cb7b58..44284bc2 100644 --- a/buildSrc/src/main/kotlin/hu/bsstudio/gradle/SpringAppConventionPlugin.kt +++ b/buildSrc/src/main/kotlin/hu/bsstudio/gradle/SpringAppConventionPlugin.kt @@ -12,5 +12,13 @@ class SpringAppConventionPlugin : Plugin { project.dependencies { add("implementation", "org.springframework.boot:spring-boot-starter") } + project.configurations.named("developmentOnly") { + extendsFrom(project.configurations.getByName("runtimeOnly")) + extendsFrom(project.configurations.getByName("implementation")) + } + project.configurations.named("annotationProcessor") { + extendsFrom(project.configurations.getByName("runtimeOnly")) + extendsFrom(project.configurations.getByName("implementation")) + } } } diff --git a/docker-compose.yml b/docker-compose.yml index 70c26c3d..75c6ab11 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,7 +28,7 @@ services: postgres: # update server/data/src/test/resources/application.yml - image: "postgres:16.3-alpine3.18@sha256:64e18e8fb3e9c9aac89ac590c5dd8306b862478404f76cd9b5f7720d012b4c47" + image: "postgres:18-alpine@sha256:2c692d47ba7074205129f25e663ee5840816bc24e9af878995ad33336d83332a" environment: POSTGRES_DB: "bss" POSTGRES_USER: "user" @@ -67,7 +67,7 @@ services: - "./docker/wiremock/stubs/oidc:/home/wiremock/mappings/oidc" prometheus: - image: "prom/prometheus:v3.7.3@sha256:49214755b6153f90a597adcbff0252cc61069f8ab69ce8411285cd4a560e8038" + image: "prom/prometheus:v3.8.0@sha256:d936808bdea528155c0154a922cd42fd75716b8bb7ba302641350f9f3eaeba09" ports: - "127.0.0.1:9090:9090" volumes: diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d43b0270..feefa10d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] -springdoc = "2.8.14" -springBoot = "3.5.8" -kotest = "6.0.5" +springdoc = "3.0.0" +springBoot = "4.0.0" +kotest = "6.0.7" spotless = "8.1.0" detekt = "1.23.8" diff --git a/integration/build.gradle.kts b/integration/build.gradle.kts index f84975aa..ac1d4852 100644 --- a/integration/build.gradle.kts +++ b/integration/build.gradle.kts @@ -8,9 +8,13 @@ plugins { } dependencies { - integrationTestImplementation(project(":server:data")) + integrationTestImplementation(project(":server:data")) { + exclude("org.springframework.boot", "spring-boot-starter-flyway") + } integrationTestImplementation(project(":client")) integrationTestImplementation("org.springframework.cloud:spring-cloud-starter-openfeign") integrationTestImplementation("org.springframework.boot:spring-boot-starter-data-jpa") integrationTestImplementation("org.springframework.boot:spring-boot-starter-json") + integrationTestImplementation("org.springframework.boot:spring-boot-data-jpa-test") + integrationTestImplementation("org.springframework.boot:spring-boot-starter-validation-test") } diff --git a/integration/src/integrationTest/kotlin/hu/bsstudio/bssweb/IntegrationTest.kt b/integration/src/integrationTest/kotlin/hu/bsstudio/bssweb/IntegrationTest.kt index 8f814d02..c0614665 100644 --- a/integration/src/integrationTest/kotlin/hu/bsstudio/bssweb/IntegrationTest.kt +++ b/integration/src/integrationTest/kotlin/hu/bsstudio/bssweb/IntegrationTest.kt @@ -18,7 +18,6 @@ import org.springframework.test.context.junit.jupiter.SpringJUnitConfig "bss.client.url=http://localhost:8080", "bss.client.username=user", "bss.client.password=password", - "spring.flyway.enabled=false", "spring.datasource.url=jdbc:postgresql://localhost:5432/bss?currentSchema=private", "spring.datasource.username=user", "spring.datasource.password=password", diff --git a/release/.gitignore b/release/.gitignore new file mode 100644 index 00000000..6d2198e0 --- /dev/null +++ b/release/.gitignore @@ -0,0 +1,132 @@ +### Node template +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + diff --git a/release/.nvmrc b/release/.nvmrc new file mode 100644 index 00000000..8ef0a525 --- /dev/null +++ b/release/.nvmrc @@ -0,0 +1 @@ +v24.11.1 diff --git a/package.json b/release/package.json similarity index 50% rename from package.json rename to release/package.json index 849c4bec..2f45819b 100644 --- a/package.json +++ b/release/package.json @@ -1,15 +1,19 @@ { "name": "bss-web-admin-backend", - "engines": { - "node": "24.11.1" - }, + "author": "csikb", + "license": "LGPL-3.0-only", "scripts": { "release": "semantic-release" }, "devDependencies": { "semantic-release": "25.0.2" }, - "author": "csikb", - "license": "LGPL-3.0-only", - "packageManager": "pnpm@10.22.0" + "packageManager": "pnpm@10.24.0", + "release": { + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/github" + ] + } } diff --git a/pnpm-lock.yaml b/release/pnpm-lock.yaml similarity index 100% rename from pnpm-lock.yaml rename to release/pnpm-lock.yaml diff --git a/server/build.gradle.kts b/server/build.gradle.kts index 00ca9d6b..870b0998 100644 --- a/server/build.gradle.kts +++ b/server/build.gradle.kts @@ -11,9 +11,8 @@ plugins { dependencies { implementation(project(":server:web")) runtimeOnly("io.micrometer:micrometer-registry-prometheus") - // todo these scopes were only supported by the spring gradle dependency management plugin - // annotationProcessor("org.springframework.boot:spring-boot-configuration-processor") - // developmentOnly("org.springframework.boot:spring-boot-devtools") + annotationProcessor("org.springframework.boot:spring-boot-configuration-processor") + developmentOnly("org.springframework.boot:spring-boot-devtools") } tasks.test { diff --git a/server/client/build.gradle.kts b/server/client/build.gradle.kts index 7b0bfaba..0746ea95 100644 --- a/server/client/build.gradle.kts +++ b/server/client/build.gradle.kts @@ -10,8 +10,9 @@ plugins { dependencies { implementation("org.springframework.cloud:spring-cloud-starter-openfeign") - implementation("com.fasterxml.jackson.module:jackson-module-kotlin") + implementation("tools.jackson.module:jackson-module-kotlin") testImplementation(libs.kotestAssertionsJson) + testImplementation("org.springframework.boot:spring-boot-starter-jackson-test") constraints { implementation("commons-fileupload:commons-fileupload") { diff --git a/server/data/build.gradle.kts b/server/data/build.gradle.kts index a0a44395..c718fa86 100644 --- a/server/data/build.gradle.kts +++ b/server/data/build.gradle.kts @@ -11,12 +11,16 @@ plugins { dependencies { api(project(":server:common")) implementation("org.springframework.boot:spring-boot-starter-data-jpa") + implementation("org.springframework.boot:spring-boot-starter-flyway") runtimeOnly("org.flywaydb:flyway-core") runtimeOnly("org.flywaydb:flyway-database-postgresql") runtimeOnly("org.postgresql:postgresql") runtimeOnly("org.hibernate.validator:hibernate-validator") + testImplementation("org.springframework.boot:spring-boot-data-jpa-test") + testImplementation("org.springframework.boot:spring-boot-starter-flyway-test") + testImplementation("org.springframework.boot:spring-boot-starter-validation-test") testImplementation("org.springframework.boot:spring-boot-testcontainers") testImplementation("org.testcontainers:testcontainers") - testImplementation("org.testcontainers:postgresql") - testImplementation("org.testcontainers:junit-jupiter") + testImplementation("org.testcontainers:testcontainers-postgresql") + testImplementation("org.testcontainers:testcontainers-junit-jupiter") } diff --git a/server/data/src/main/kotlin/hu/bsstudio/bssweb/DataConfig.kt b/server/data/src/main/kotlin/hu/bsstudio/bssweb/DataConfig.kt index 88aefd3e..a029b3b5 100644 --- a/server/data/src/main/kotlin/hu/bsstudio/bssweb/DataConfig.kt +++ b/server/data/src/main/kotlin/hu/bsstudio/bssweb/DataConfig.kt @@ -1,7 +1,7 @@ package hu.bsstudio.bssweb import org.springframework.boot.autoconfigure.EnableAutoConfiguration -import org.springframework.boot.autoconfigure.domain.EntityScan +import org.springframework.boot.persistence.autoconfigure.EntityScan import org.springframework.context.annotation.ComponentScan @EnableAutoConfiguration diff --git a/server/data/src/test/kotlin/hu/bsstudio/bssweb/event/repository/DetailedEventRepositoryTest.kt b/server/data/src/test/kotlin/hu/bsstudio/bssweb/event/repository/DetailedEventRepositoryTest.kt index 768aa0c0..1522ad09 100644 --- a/server/data/src/test/kotlin/hu/bsstudio/bssweb/event/repository/DetailedEventRepositoryTest.kt +++ b/server/data/src/test/kotlin/hu/bsstudio/bssweb/event/repository/DetailedEventRepositoryTest.kt @@ -14,9 +14,9 @@ import io.kotest.matchers.optional.shouldBePresent import io.kotest.matchers.shouldBe import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase -import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest -import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager +import org.springframework.boot.data.jpa.test.autoconfigure.DataJpaTest +import org.springframework.boot.jdbc.test.autoconfigure.AutoConfigureTestDatabase +import org.springframework.boot.jpa.test.autoconfigure.TestEntityManager import java.time.Instant import java.time.LocalDate import java.util.UUID diff --git a/server/data/src/test/kotlin/hu/bsstudio/bssweb/event/repository/EventRepositoryTest.kt b/server/data/src/test/kotlin/hu/bsstudio/bssweb/event/repository/EventRepositoryTest.kt index 682b5158..d8640696 100644 --- a/server/data/src/test/kotlin/hu/bsstudio/bssweb/event/repository/EventRepositoryTest.kt +++ b/server/data/src/test/kotlin/hu/bsstudio/bssweb/event/repository/EventRepositoryTest.kt @@ -8,9 +8,9 @@ import io.kotest.matchers.optional.shouldBeEmpty import io.kotest.matchers.optional.shouldBePresent import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase -import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest -import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager +import org.springframework.boot.data.jpa.test.autoconfigure.DataJpaTest +import org.springframework.boot.jdbc.test.autoconfigure.AutoConfigureTestDatabase +import org.springframework.boot.jpa.test.autoconfigure.TestEntityManager import java.time.Instant import java.time.LocalDate import kotlin.time.Duration.Companion.minutes diff --git a/server/data/src/test/kotlin/hu/bsstudio/bssweb/eventvideo/repository/EventVideoRepositoryTest.kt b/server/data/src/test/kotlin/hu/bsstudio/bssweb/eventvideo/repository/EventVideoRepositoryTest.kt index 7e43993c..dd327d9d 100644 --- a/server/data/src/test/kotlin/hu/bsstudio/bssweb/eventvideo/repository/EventVideoRepositoryTest.kt +++ b/server/data/src/test/kotlin/hu/bsstudio/bssweb/eventvideo/repository/EventVideoRepositoryTest.kt @@ -11,8 +11,8 @@ import io.kotest.matchers.optional.shouldBePresent import io.kotest.matchers.shouldBe import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase -import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest +import org.springframework.boot.data.jpa.test.autoconfigure.DataJpaTest +import org.springframework.boot.jdbc.test.autoconfigure.AutoConfigureTestDatabase @DataJpaTest @AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE) diff --git a/server/data/src/test/kotlin/hu/bsstudio/bssweb/label/repository/LabelEntityRepositoryTest.kt b/server/data/src/test/kotlin/hu/bsstudio/bssweb/label/repository/LabelEntityRepositoryTest.kt index d5dd452c..6e5602ba 100644 --- a/server/data/src/test/kotlin/hu/bsstudio/bssweb/label/repository/LabelEntityRepositoryTest.kt +++ b/server/data/src/test/kotlin/hu/bsstudio/bssweb/label/repository/LabelEntityRepositoryTest.kt @@ -5,9 +5,9 @@ import io.kotest.matchers.longs.shouldBeExactly import io.kotest.matchers.shouldBe import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase -import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest -import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager +import org.springframework.boot.data.jpa.test.autoconfigure.DataJpaTest +import org.springframework.boot.jdbc.test.autoconfigure.AutoConfigureTestDatabase +import org.springframework.boot.jpa.test.autoconfigure.TestEntityManager @DataJpaTest @AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE) diff --git a/server/data/src/test/kotlin/hu/bsstudio/bssweb/member/repository/MemberRepositoryTest.kt b/server/data/src/test/kotlin/hu/bsstudio/bssweb/member/repository/MemberRepositoryTest.kt index 255c080f..8d39d77a 100644 --- a/server/data/src/test/kotlin/hu/bsstudio/bssweb/member/repository/MemberRepositoryTest.kt +++ b/server/data/src/test/kotlin/hu/bsstudio/bssweb/member/repository/MemberRepositoryTest.kt @@ -9,9 +9,9 @@ import io.kotest.matchers.optional.shouldBeEmpty import io.kotest.matchers.optional.shouldBePresent import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase -import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest -import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager +import org.springframework.boot.data.jpa.test.autoconfigure.DataJpaTest +import org.springframework.boot.jdbc.test.autoconfigure.AutoConfigureTestDatabase +import org.springframework.boot.jpa.test.autoconfigure.TestEntityManager import java.time.Instant import java.time.LocalDate import kotlin.time.Duration.Companion.minutes diff --git a/server/data/src/test/kotlin/hu/bsstudio/bssweb/video/repository/DetailedVideoRepositoryTest.kt b/server/data/src/test/kotlin/hu/bsstudio/bssweb/video/repository/DetailedVideoRepositoryTest.kt index eb927c51..2b78b5a1 100644 --- a/server/data/src/test/kotlin/hu/bsstudio/bssweb/video/repository/DetailedVideoRepositoryTest.kt +++ b/server/data/src/test/kotlin/hu/bsstudio/bssweb/video/repository/DetailedVideoRepositoryTest.kt @@ -18,9 +18,9 @@ import io.kotest.matchers.optional.shouldBeEmpty import io.kotest.matchers.optional.shouldBePresent import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase -import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest -import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager +import org.springframework.boot.data.jpa.test.autoconfigure.DataJpaTest +import org.springframework.boot.jdbc.test.autoconfigure.AutoConfigureTestDatabase +import org.springframework.boot.jpa.test.autoconfigure.TestEntityManager import java.time.Instant import java.time.LocalDate import java.util.UUID diff --git a/server/data/src/test/kotlin/hu/bsstudio/bssweb/video/repository/SimpleVideoRepositoryTest.kt b/server/data/src/test/kotlin/hu/bsstudio/bssweb/video/repository/SimpleVideoRepositoryTest.kt index b6111d0d..b080cc85 100644 --- a/server/data/src/test/kotlin/hu/bsstudio/bssweb/video/repository/SimpleVideoRepositoryTest.kt +++ b/server/data/src/test/kotlin/hu/bsstudio/bssweb/video/repository/SimpleVideoRepositoryTest.kt @@ -9,9 +9,9 @@ import io.kotest.matchers.optional.shouldBeEmpty import io.kotest.matchers.optional.shouldBePresent import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase -import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest -import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager +import org.springframework.boot.data.jpa.test.autoconfigure.DataJpaTest +import org.springframework.boot.jdbc.test.autoconfigure.AutoConfigureTestDatabase +import org.springframework.boot.jpa.test.autoconfigure.TestEntityManager import java.time.Instant import java.time.LocalDate import kotlin.time.Duration.Companion.minutes diff --git a/server/data/src/test/kotlin/hu/bsstudio/bssweb/videocrew/repository/VideoCrewRepositoryTest.kt b/server/data/src/test/kotlin/hu/bsstudio/bssweb/videocrew/repository/VideoCrewRepositoryTest.kt index cc334b27..554c1460 100644 --- a/server/data/src/test/kotlin/hu/bsstudio/bssweb/videocrew/repository/VideoCrewRepositoryTest.kt +++ b/server/data/src/test/kotlin/hu/bsstudio/bssweb/videocrew/repository/VideoCrewRepositoryTest.kt @@ -12,8 +12,8 @@ import io.kotest.matchers.optional.shouldBePresent import io.kotest.matchers.shouldBe import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase -import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest +import org.springframework.boot.data.jpa.test.autoconfigure.DataJpaTest +import org.springframework.boot.jdbc.test.autoconfigure.AutoConfigureTestDatabase @DataJpaTest @AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE) diff --git a/server/data/src/test/resources/application.yml b/server/data/src/test/resources/application.yml index 33fccfc8..6145456b 100644 --- a/server/data/src/test/resources/application.yml +++ b/server/data/src/test/resources/application.yml @@ -1,6 +1,6 @@ spring: datasource: - url: jdbc:tc:postgresql:16.3-alpine3.18:///db?currentSchema=private + url: jdbc:tc:postgresql:18-alpine:///db?currentSchema=private flyway: default-schema: private schemas: "private,public" diff --git a/server/model/build.gradle.kts b/server/model/build.gradle.kts index 874eb654..dfb1e429 100644 --- a/server/model/build.gradle.kts +++ b/server/model/build.gradle.kts @@ -10,6 +10,7 @@ plugins { dependencies { api(project(":server:common")) implementation("org.springframework.boot:spring-boot-starter-json") - implementation("com.fasterxml.jackson.module:jackson-module-kotlin") + implementation("tools.jackson.module:jackson-module-kotlin") testImplementation(libs.kotestAssertionsJson) + testImplementation("org.springframework.boot:spring-boot-starter-jackson-test") } diff --git a/server/web/build.gradle.kts b/server/web/build.gradle.kts index 0eb3b204..e0deb2ca 100644 --- a/server/web/build.gradle.kts +++ b/server/web/build.gradle.kts @@ -12,19 +12,12 @@ dependencies { api(project(":server:operation")) api(project(":server:service")) implementation("org.springframework.boot:spring-boot-starter-actuator") - implementation("org.springframework.boot:spring-boot-starter-web") + implementation("org.springframework.boot:spring-boot-starter-webmvc") implementation("org.springframework.boot:spring-boot-starter-security") - implementation("org.springframework.boot:spring-boot-starter-oauth2-resource-server") + implementation("org.springframework.boot:spring-boot-starter-security-oauth2-resource-server") implementation(libs.springdocOpenapiStarterWebmvcUi) implementation("org.springframework.data:spring-data-commons") testImplementation("org.springframework.security:spring-security-test") - - constraints { - implementation("com.nimbusds:nimbus-jose-jwt") { - version { - require("[9.37.4,)") - } - because("CVE-2025-53864") - } - } + testImplementation("org.springframework.boot:spring-boot-starter-webmvc-test") + testImplementation("org.springframework.boot:spring-boot-starter-jackson-test") } diff --git a/server/web/src/main/kotlin/hu/bsstudio/bssweb/security/config/SecurityConfig.kt b/server/web/src/main/kotlin/hu/bsstudio/bssweb/security/config/SecurityConfig.kt index d16b6ccb..5a8fe644 100644 --- a/server/web/src/main/kotlin/hu/bsstudio/bssweb/security/config/SecurityConfig.kt +++ b/server/web/src/main/kotlin/hu/bsstudio/bssweb/security/config/SecurityConfig.kt @@ -1,8 +1,8 @@ package hu.bsstudio.bssweb.security.config -import org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest -import org.springframework.boot.actuate.health.HealthEndpoint import org.springframework.boot.actuate.info.InfoEndpoint +import org.springframework.boot.health.actuate.endpoint.HealthEndpoint +import org.springframework.boot.security.autoconfigure.actuate.web.servlet.EndpointRequest import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.security.config.annotation.web.builders.HttpSecurity diff --git a/server/web/src/test/kotlin/hu/bsstudio/bssweb/event/controller/EventControllerTest.kt b/server/web/src/test/kotlin/hu/bsstudio/bssweb/event/controller/EventControllerTest.kt index bc299737..036c0fd3 100644 --- a/server/web/src/test/kotlin/hu/bsstudio/bssweb/event/controller/EventControllerTest.kt +++ b/server/web/src/test/kotlin/hu/bsstudio/bssweb/event/controller/EventControllerTest.kt @@ -1,6 +1,5 @@ package hu.bsstudio.bssweb.event.controller -import com.fasterxml.jackson.databind.ObjectMapper import com.ninjasquad.springmockk.MockkBean import hu.bsstudio.bssweb.event.model.CreateEvent import hu.bsstudio.bssweb.event.model.DetailedEvent @@ -11,7 +10,7 @@ import hu.bsstudio.bssweb.video.model.Video import io.mockk.every import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest +import org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest import org.springframework.http.MediaType import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.httpBasic @@ -20,6 +19,7 @@ import org.springframework.test.web.servlet.delete import org.springframework.test.web.servlet.get import org.springframework.test.web.servlet.post import org.springframework.test.web.servlet.put +import tools.jackson.databind.ObjectMapper import java.time.LocalDate import java.util.Optional import java.util.UUID diff --git a/server/web/src/test/kotlin/hu/bsstudio/bssweb/eventvideo/controller/EventVideoControllerTest.kt b/server/web/src/test/kotlin/hu/bsstudio/bssweb/eventvideo/controller/EventVideoControllerTest.kt index a194fdba..06b0c334 100644 --- a/server/web/src/test/kotlin/hu/bsstudio/bssweb/eventvideo/controller/EventVideoControllerTest.kt +++ b/server/web/src/test/kotlin/hu/bsstudio/bssweb/eventvideo/controller/EventVideoControllerTest.kt @@ -1,18 +1,18 @@ package hu.bsstudio.bssweb.eventvideo.controller -import com.fasterxml.jackson.databind.ObjectMapper import com.ninjasquad.springmockk.MockkBean import hu.bsstudio.bssweb.event.model.DetailedEvent import hu.bsstudio.bssweb.eventvideo.service.EventVideoService import io.mockk.every import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest +import org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.httpBasic import org.springframework.test.web.servlet.MockMvc import org.springframework.test.web.servlet.delete import org.springframework.test.web.servlet.post +import tools.jackson.databind.ObjectMapper import java.time.LocalDate import java.util.Optional import java.util.UUID diff --git a/server/web/src/test/kotlin/hu/bsstudio/bssweb/label/controller/LabelControllerTest.kt b/server/web/src/test/kotlin/hu/bsstudio/bssweb/label/controller/LabelControllerTest.kt index 9a06c043..b5ab4f59 100644 --- a/server/web/src/test/kotlin/hu/bsstudio/bssweb/label/controller/LabelControllerTest.kt +++ b/server/web/src/test/kotlin/hu/bsstudio/bssweb/label/controller/LabelControllerTest.kt @@ -1,6 +1,5 @@ package hu.bsstudio.bssweb.label.controller -import com.fasterxml.jackson.databind.ObjectMapper import com.ninjasquad.springmockk.MockkBean import hu.bsstudio.bssweb.label.model.CreateLabel import hu.bsstudio.bssweb.label.model.Label @@ -8,7 +7,7 @@ import hu.bsstudio.bssweb.label.service.LabelService import io.mockk.every import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest +import org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest import org.springframework.http.MediaType import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.httpBasic @@ -16,6 +15,7 @@ import org.springframework.test.web.servlet.MockMvc import org.springframework.test.web.servlet.delete import org.springframework.test.web.servlet.get import org.springframework.test.web.servlet.post +import tools.jackson.databind.ObjectMapper import java.util.UUID @WebMvcTest(LabelController::class) diff --git a/server/web/src/test/kotlin/hu/bsstudio/bssweb/member/controller/MemberControllerTest.kt b/server/web/src/test/kotlin/hu/bsstudio/bssweb/member/controller/MemberControllerTest.kt index c04144fd..670f016f 100644 --- a/server/web/src/test/kotlin/hu/bsstudio/bssweb/member/controller/MemberControllerTest.kt +++ b/server/web/src/test/kotlin/hu/bsstudio/bssweb/member/controller/MemberControllerTest.kt @@ -1,6 +1,5 @@ package hu.bsstudio.bssweb.member.controller -import com.fasterxml.jackson.databind.ObjectMapper import com.ninjasquad.springmockk.MockkBean import hu.bsstudio.bssweb.member.common.MemberStatus import hu.bsstudio.bssweb.member.model.CreateMember @@ -10,7 +9,7 @@ import hu.bsstudio.bssweb.member.service.MemberService import io.mockk.every import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest +import org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest import org.springframework.http.MediaType import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.httpBasic @@ -19,6 +18,7 @@ import org.springframework.test.web.servlet.delete import org.springframework.test.web.servlet.get import org.springframework.test.web.servlet.post import org.springframework.test.web.servlet.put +import tools.jackson.databind.ObjectMapper import java.time.LocalDate import java.util.Optional import java.util.UUID diff --git a/server/web/src/test/kotlin/hu/bsstudio/bssweb/metrics/controller/MetricsControllerTest.kt b/server/web/src/test/kotlin/hu/bsstudio/bssweb/metrics/controller/MetricsControllerTest.kt index b3c802e0..4d095f9e 100644 --- a/server/web/src/test/kotlin/hu/bsstudio/bssweb/metrics/controller/MetricsControllerTest.kt +++ b/server/web/src/test/kotlin/hu/bsstudio/bssweb/metrics/controller/MetricsControllerTest.kt @@ -1,16 +1,16 @@ package hu.bsstudio.bssweb.metrics.controller -import com.fasterxml.jackson.databind.ObjectMapper import com.ninjasquad.springmockk.MockkBean import hu.bsstudio.bssweb.metrics.model.BssMetrics import hu.bsstudio.bssweb.metrics.service.MetricsService import io.mockk.every import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest +import org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.httpBasic import org.springframework.test.web.servlet.MockMvc import org.springframework.test.web.servlet.get +import tools.jackson.databind.ObjectMapper @WebMvcTest(MetricsController::class) internal class MetricsControllerTest( diff --git a/server/web/src/test/kotlin/hu/bsstudio/bssweb/video/controller/VideoControllerTest.kt b/server/web/src/test/kotlin/hu/bsstudio/bssweb/video/controller/VideoControllerTest.kt index df59f671..658d2b10 100644 --- a/server/web/src/test/kotlin/hu/bsstudio/bssweb/video/controller/VideoControllerTest.kt +++ b/server/web/src/test/kotlin/hu/bsstudio/bssweb/video/controller/VideoControllerTest.kt @@ -1,6 +1,5 @@ package hu.bsstudio.bssweb.video.controller -import com.fasterxml.jackson.databind.ObjectMapper import com.ninjasquad.springmockk.MockkBean import hu.bsstudio.bssweb.video.model.CreateVideo import hu.bsstudio.bssweb.video.model.DetailedVideo @@ -10,7 +9,7 @@ import hu.bsstudio.bssweb.video.service.VideoService import io.mockk.every import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest +import org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest import org.springframework.data.domain.PageImpl import org.springframework.data.domain.PageRequest import org.springframework.data.domain.Pageable @@ -22,6 +21,7 @@ import org.springframework.test.web.servlet.delete import org.springframework.test.web.servlet.get import org.springframework.test.web.servlet.post import org.springframework.test.web.servlet.put +import tools.jackson.databind.ObjectMapper import java.time.LocalDate import java.util.Optional import java.util.UUID diff --git a/server/web/src/test/kotlin/hu/bsstudio/bssweb/videocrew/controller/VideoCrewControllerTest.kt b/server/web/src/test/kotlin/hu/bsstudio/bssweb/videocrew/controller/VideoCrewControllerTest.kt index 1fc9da22..4a6f3e70 100644 --- a/server/web/src/test/kotlin/hu/bsstudio/bssweb/videocrew/controller/VideoCrewControllerTest.kt +++ b/server/web/src/test/kotlin/hu/bsstudio/bssweb/videocrew/controller/VideoCrewControllerTest.kt @@ -1,6 +1,5 @@ package hu.bsstudio.bssweb.videocrew.controller -import com.fasterxml.jackson.databind.ObjectMapper import com.ninjasquad.springmockk.MockkBean import hu.bsstudio.bssweb.video.model.DetailedVideo import hu.bsstudio.bssweb.videocrew.model.VideoCrewRequest @@ -8,13 +7,14 @@ import hu.bsstudio.bssweb.videocrew.service.VideoCrewService import io.mockk.every import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest +import org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.httpBasic import org.springframework.test.web.servlet.MockMvc import org.springframework.test.web.servlet.delete import org.springframework.test.web.servlet.get import org.springframework.test.web.servlet.put +import tools.jackson.databind.ObjectMapper import java.time.LocalDate import java.util.Optional import java.util.UUID