From 4005eb4160b1b5ebd6488f220d9f21733055a920 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 08:46:41 +0000 Subject: [PATCH 1/7] Bump kapt from 1.9.23 to 1.9.24 Bumps [kapt](https://github.com/JetBrains/kotlin) from 1.9.23 to 1.9.24. - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/commits) --- updated-dependencies: - dependency-name: kapt dependency-type: direct:production update-type: version-update:semver-patch ... 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 c5c56b3a..d800dab4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -29,7 +29,7 @@ val mockitoVersion = "5.11.0" plugins { kotlin("jvm") version "2.0.0-RC2" - kotlin("kapt") version "1.9.23" + kotlin("kapt") version "1.9.24" id("io.ktor.plugin") version "2.3.10" jacoco id("org.sonarqube") version "5.0.0.4638" From f4532ce3c8ed82d6c2380d2246818abb064e13de Mon Sep 17 00:00:00 2001 From: Ziedelth Date: Tue, 7 May 2024 12:52:30 +0200 Subject: [PATCH 2/7] Fallback to kotlin 1.9.24 --- .github/workflows/codeql.yml | 12 ++++++++---- build.gradle.kts | 10 +++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f9a9d8ba..d8639e10 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,9 +13,13 @@ name: "CodeQL" on: push: - branches: [ "master","dev" ] + branches: + - master + - dev pull_request: - branches: [ "master","dev" ] + branches: + - master + - dev schedule: - cron: '33 14 * * 5' @@ -44,8 +48,8 @@ jobs: fail-fast: false matrix: include: - # - language: java-kotlin - # build-mode: autobuild + - language: java-kotlin + build-mode: autobuild - language: javascript-typescript build-mode: none # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' diff --git a/build.gradle.kts b/build.gradle.kts index d800dab4..c5aeb9dd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -28,11 +28,15 @@ val h2Version = "2.2.224" val mockitoVersion = "5.11.0" plugins { - kotlin("jvm") version "2.0.0-RC2" - kotlin("kapt") version "1.9.24" + val kotlinVersion = "1.9.24" + + kotlin("jvm") version kotlinVersion + kotlin("kapt") version kotlinVersion + id("io.ktor.plugin") version "2.3.10" - jacoco id("org.sonarqube") version "5.0.0.4638" + + jacoco } group = "fr.shikkanime" From eb718c35ab3751a42c3c4a13ef6f2ff5dc12a52d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 May 2024 08:42:16 +0000 Subject: [PATCH 3/7] Bump the ktor group with 20 updates Bumps the ktor group with 20 updates: | Package | From | To | | --- | --- | --- | | [io.ktor:ktor-server-core-jvm](https://github.com/ktorio/ktor) | `2.3.10` | `2.3.11` | | [io.ktor:ktor-server-auth-jvm](https://github.com/ktorio/ktor) | `2.3.10` | `2.3.11` | | [io.ktor:ktor-server-auth-jwt-jvm](https://github.com/ktorio/ktor) | `2.3.10` | `2.3.11` | | [io.ktor:ktor-server-sessions](https://github.com/ktorio/ktor) | `2.3.10` | `2.3.11` | | [io.ktor:ktor-server-sessions-jvm](https://github.com/ktorio/ktor) | `2.3.10` | `2.3.11` | | [io.ktor:ktor-server-host-common-jvm](https://github.com/ktorio/ktor) | `2.3.10` | `2.3.11` | | [io.ktor:ktor-server-status-pages-jvm](https://github.com/ktorio/ktor) | `2.3.10` | `2.3.11` | | [io.ktor:ktor-server-caching-headers-jvm](https://github.com/ktorio/ktor) | `2.3.10` | `2.3.11` | | [io.ktor:ktor-server-compression-jvm](https://github.com/ktorio/ktor) | `2.3.10` | `2.3.11` | | [io.ktor:ktor-server-cors-jvm](https://github.com/ktorio/ktor) | `2.3.10` | `2.3.11` | | [io.ktor:ktor-server-content-negotiation-jvm](https://github.com/ktorio/ktor) | `2.3.10` | `2.3.11` | | [io.ktor:ktor-serialization-gson](https://github.com/ktorio/ktor) | `2.3.10` | `2.3.11` | | [io.ktor:ktor-server-freemarker-jvm](https://github.com/ktorio/ktor) | `2.3.10` | `2.3.11` | | [io.ktor:ktor-server-netty](https://github.com/ktorio/ktor) | `2.3.10` | `2.3.11` | | [io.ktor:ktor-client-core](https://github.com/ktorio/ktor) | `2.3.10` | `2.3.11` | | [io.ktor:ktor-client-okhttp](https://github.com/ktorio/ktor) | `2.3.10` | `2.3.11` | | [io.ktor:ktor-client-okhttp-jvm](https://github.com/ktorio/ktor) | `2.3.10` | `2.3.11` | | [io.ktor:ktor-server-tests-jvm](https://github.com/ktorio/ktor) | `2.3.10` | `2.3.11` | | [io.ktor:ktor-client-mock](https://github.com/ktorio/ktor) | `2.3.10` | `2.3.11` | | io.ktor.plugin | `2.3.10` | `2.3.11` | Updates `io.ktor:ktor-server-core-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-auth-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-auth-jwt-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-sessions` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-sessions-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-host-common-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-status-pages-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-caching-headers-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-compression-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-cors-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-content-negotiation-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-serialization-gson` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-freemarker-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-netty` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-client-core` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-client-okhttp` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-client-okhttp-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-tests-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-client-mock` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-auth-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-auth-jwt-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-sessions` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-sessions-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-host-common-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-status-pages-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-caching-headers-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-compression-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-cors-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-content-negotiation-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-serialization-gson` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-freemarker-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-netty` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-client-core` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-client-okhttp` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-client-okhttp-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-server-tests-jvm` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor:ktor-client-mock` from 2.3.10 to 2.3.11 - [Release notes](https://github.com/ktorio/ktor/releases) - [Changelog](https://github.com/ktorio/ktor/blob/2.3.11/CHANGELOG.md) - [Commits](https://github.com/ktorio/ktor/compare/2.3.10...2.3.11) Updates `io.ktor.plugin` from 2.3.10 to 2.3.11 --- updated-dependencies: - dependency-name: io.ktor:ktor-server-core-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-auth-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-auth-jwt-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-sessions dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-sessions-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-host-common-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-status-pages-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-caching-headers-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-compression-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-cors-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-content-negotiation-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-serialization-gson dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-freemarker-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-netty dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-client-core dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-client-okhttp dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-client-okhttp-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-tests-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-client-mock dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-auth-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-auth-jwt-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-sessions dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-sessions-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-host-common-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-status-pages-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-caching-headers-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-compression-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-cors-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-content-negotiation-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-serialization-gson dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-freemarker-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-netty dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-client-core dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-client-okhttp dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-client-okhttp-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-server-tests-jvm dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor:ktor-client-mock dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor - dependency-name: io.ktor.plugin dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ktor ... Signed-off-by: dependabot[bot] --- build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index c5aeb9dd..ee36dd33 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,4 @@ -val ktorVersion = "2.3.10" +val ktorVersion = "2.3.11" val ktorSwaggerUiVersion = "2.9.0" val hibernateCoreVersion = "6.5.0.Final" val ehcacheVersion = "3.10.8" @@ -33,7 +33,7 @@ plugins { kotlin("jvm") version kotlinVersion kotlin("kapt") version kotlinVersion - id("io.ktor.plugin") version "2.3.10" + id("io.ktor.plugin") version "2.3.11" id("org.sonarqube") version "5.0.0.4638" jacoco From cfdeca98a95d9be4a5443fca5c3f0c532d31c938 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 May 2024 09:02:39 +0000 Subject: [PATCH 4/7] Bump prantlf/delete-cache-action from 2 to 3 Bumps [prantlf/delete-cache-action](https://github.com/prantlf/delete-cache-action) from 2 to 3. - [Release notes](https://github.com/prantlf/delete-cache-action/releases) - [Changelog](https://github.com/prantlf/delete-cache-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/prantlf/delete-cache-action/compare/v2...v3) --- updated-dependencies: - dependency-name: prantlf/delete-cache-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/global_workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/global_workflow.yml b/.github/workflows/global_workflow.yml index b966afa3..3b56275a 100644 --- a/.github/workflows/global_workflow.yml +++ b/.github/workflows/global_workflow.yml @@ -140,11 +140,11 @@ jobs: - uses: actions/checkout@v4 - name: Clear build cache - uses: prantlf/delete-cache-action@v2 + uses: prantlf/delete-cache-action@v3 with: key: ${{ runner.os }}-build-${{ hashFiles('**/build.gradle.kts') }}-${{ github.sha }} - name: Clear gradle cache - uses: prantlf/delete-cache-action@v2 + uses: prantlf/delete-cache-action@v3 with: key: ${{ runner.os }}-dev-dependencies-${{ hashFiles('**/build.gradle.kts') }}-${{ github.sha }} \ No newline at end of file From 774c36b4f4e44c993c5291c7cfe60add8c84c4a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 08:15:09 +0000 Subject: [PATCH 5/7] Bump org.mockito:mockito-core from 5.11.0 to 5.12.0 Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.11.0 to 5.12.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.11.0...v5.12.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core 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 ee36dd33..87f1eb78 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,7 +25,7 @@ val twitter4jV2Version = "1.4.3" val junitVersion = "5.10.2" val h2Version = "2.2.224" -val mockitoVersion = "5.11.0" +val mockitoVersion = "5.12.0" plugins { val kotlinVersion = "1.9.24" From ed62b89453e2a38bbaf442d38b499b909c742fe9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 08:15:14 +0000 Subject: [PATCH 6/7] Bump net.dv8tion:JDA from 5.0.0-beta.23 to 5.0.0-beta.24 Bumps [net.dv8tion:JDA](https://github.com/discord-jda/JDA) from 5.0.0-beta.23 to 5.0.0-beta.24. - [Release notes](https://github.com/discord-jda/JDA/releases) - [Commits](https://github.com/discord-jda/JDA/compare/v5.0.0-beta.23...v5.0.0-beta.24) --- updated-dependencies: - dependency-name: net.dv8tion:JDA dependency-type: direct:production update-type: version-update:semver-patch ... 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 87f1eb78..ba49edd0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,7 +19,7 @@ val bcprovVersion = "1.78.1" val javaImageScalingVersion = "0.8.6" val firebaseVersion = "9.2.0" -val jdaVersion = "5.0.0-beta.23" +val jdaVersion = "5.0.0-beta.24" val twitter4jVersion = "4.0.7" val twitter4jV2Version = "1.4.3" From dfc7a073c58ac51898f8f2847a8dcbf276ff99ef Mon Sep 17 00:00:00 2001 From: Ziedelth Date: Mon, 13 May 2024 16:26:29 +0200 Subject: [PATCH 7/7] Add missed animes --- .../caches/UUIDPaginationKeyCache.kt | 9 +++ .../controllers/api/AnimeController.kt | 36 ++++++++- .../member/MemberToMemberDtoConverter.kt | 4 +- .../fr/shikkanime/dtos/MissedAnimeDto.kt | 6 ++ .../repositories/AbstractRepository.kt | 6 +- .../repositories/AnimeRepository.kt | 2 +- .../repositories/EpisodeMappingRepository.kt | 2 +- .../repositories/EpisodeVariantRepository.kt | 2 +- .../MemberFollowAnimeRepository.kt | 33 +++++++- .../MemberFollowEpisodeRepository.kt | 32 ++++++-- .../services/MemberFollowAnimeService.kt | 6 +- .../services/MemberFollowEpisodeService.kt | 4 +- .../caches/MemberFollowAnimeCacheService.kt | 57 ++++++++++++++ .../controllers/api/AnimeControllerTest.kt | 78 ++++++++++++++++++- .../controllers/api/MemberControllerTest.kt | 14 ++-- 15 files changed, 257 insertions(+), 34 deletions(-) create mode 100644 src/main/kotlin/fr/shikkanime/caches/UUIDPaginationKeyCache.kt create mode 100644 src/main/kotlin/fr/shikkanime/dtos/MissedAnimeDto.kt create mode 100644 src/main/kotlin/fr/shikkanime/services/caches/MemberFollowAnimeCacheService.kt diff --git a/src/main/kotlin/fr/shikkanime/caches/UUIDPaginationKeyCache.kt b/src/main/kotlin/fr/shikkanime/caches/UUIDPaginationKeyCache.kt new file mode 100644 index 00000000..b554590c --- /dev/null +++ b/src/main/kotlin/fr/shikkanime/caches/UUIDPaginationKeyCache.kt @@ -0,0 +1,9 @@ +package fr.shikkanime.caches + +import java.util.* + +open class UUIDPaginationKeyCache( + open val uuid: UUID, + open val page: Int, + open val limit: Int, +) diff --git a/src/main/kotlin/fr/shikkanime/controllers/api/AnimeController.kt b/src/main/kotlin/fr/shikkanime/controllers/api/AnimeController.kt index cb726409..2857dc94 100644 --- a/src/main/kotlin/fr/shikkanime/controllers/api/AnimeController.kt +++ b/src/main/kotlin/fr/shikkanime/controllers/api/AnimeController.kt @@ -2,14 +2,12 @@ package fr.shikkanime.controllers.api import com.google.inject.Inject import fr.shikkanime.converters.AbstractConverter -import fr.shikkanime.dtos.AnimeDto -import fr.shikkanime.dtos.MessageDto -import fr.shikkanime.dtos.PageableDto -import fr.shikkanime.dtos.WeeklyAnimesDto +import fr.shikkanime.dtos.* import fr.shikkanime.dtos.enums.Status import fr.shikkanime.entities.enums.CountryCode import fr.shikkanime.services.AnimeService import fr.shikkanime.services.caches.AnimeCacheService +import fr.shikkanime.services.caches.MemberFollowAnimeCacheService import fr.shikkanime.utils.routes.* import fr.shikkanime.utils.routes.method.Delete import fr.shikkanime.utils.routes.method.Get @@ -31,6 +29,9 @@ class AnimeController : HasPageableRoute() { @Inject private lateinit var animeService: AnimeService + @Inject + private lateinit var memberFollowAnimeCacheService: MemberFollowAnimeCacheService + @Path @Get @OpenAPI( @@ -211,4 +212,31 @@ class AnimeController : HasPageableRoute() { ) ) } + + @Path("/missed") + @Get + @JWTAuthenticated + @OpenAPI( + "Get missed animes", + [ + OpenAPIResponse( + 200, + "Get missed animes", + PageableDto::class, + ), + OpenAPIResponse(401, "Unauthorized") + ], + security = true + ) + private fun getMissedAnimes( + @JWTUser uuid: UUID, + @QueryParam("page") pageParam: Int?, + @QueryParam("limit") limitParam: Int?, + ): Response { + val (page, limit, _) = pageableRoute(pageParam, limitParam, null, null) + + return Response.ok( + memberFollowAnimeCacheService.getMissedAnimes(uuid, page, limit) ?: return Response.notFound() + ) + } } \ No newline at end of file diff --git a/src/main/kotlin/fr/shikkanime/converters/member/MemberToMemberDtoConverter.kt b/src/main/kotlin/fr/shikkanime/converters/member/MemberToMemberDtoConverter.kt index 5697eb70..f15af206 100644 --- a/src/main/kotlin/fr/shikkanime/converters/member/MemberToMemberDtoConverter.kt +++ b/src/main/kotlin/fr/shikkanime/converters/member/MemberToMemberDtoConverter.kt @@ -25,8 +25,8 @@ class MemberToMemberDtoConverter : AbstractConverter() { creationDateTime = from.creationDateTime.withUTCString(), lastUpdateDateTime = from.lastUpdateDateTime.withUTCString(), isPrivate = from.isPrivate, - followedAnimes = memberFollowAnimeService.getAllFollowedAnimesUUID(from), - followedEpisodes = memberFollowEpisodeService.getAllFollowedEpisodesUUID(from), + followedAnimes = memberFollowAnimeService.findAllFollowedAnimesUUID(from), + followedEpisodes = memberFollowEpisodeService.findAllFollowedEpisodesUUID(from), totalDuration = memberFollowEpisodeService.getTotalDuration(from), ) } diff --git a/src/main/kotlin/fr/shikkanime/dtos/MissedAnimeDto.kt b/src/main/kotlin/fr/shikkanime/dtos/MissedAnimeDto.kt new file mode 100644 index 00000000..b8438ccd --- /dev/null +++ b/src/main/kotlin/fr/shikkanime/dtos/MissedAnimeDto.kt @@ -0,0 +1,6 @@ +package fr.shikkanime.dtos + +data class MissedAnimeDto( + val anime: AnimeDto, + val episodeMissed: Long, +) diff --git a/src/main/kotlin/fr/shikkanime/repositories/AbstractRepository.kt b/src/main/kotlin/fr/shikkanime/repositories/AbstractRepository.kt index 66fd6e34..68a8b76f 100644 --- a/src/main/kotlin/fr/shikkanime/repositories/AbstractRepository.kt +++ b/src/main/kotlin/fr/shikkanime/repositories/AbstractRepository.kt @@ -42,18 +42,18 @@ abstract class AbstractRepository { .setHint(AvailableHints.HINT_READ_ONLY, true) } - fun buildPageableQuery(query: TypedQuery, page: Int, limit: Int): Pageable { + fun buildPageableQuery(query: TypedQuery, page: Int, limit: Int): Pageable { val scrollableResults = query.unwrap(Query::class.java) .setReadOnly(true) .setFetchSize(limit) .scroll(ScrollMode.SCROLL_SENSITIVE) - val list = mutableListOf() + val list = mutableListOf() var total = 0L if (scrollableResults.first() && scrollableResults.scroll((limit * page) - limit)) { for (i in 0 until limit) { - list.add(scrollableResults.get() as E) // NOSONAR + list.add(scrollableResults.get() as C) // NOSONAR if (!scrollableResults.next()) break } total = if (scrollableResults.last()) scrollableResults.rowNumber + 1L else 0 diff --git a/src/main/kotlin/fr/shikkanime/repositories/AnimeRepository.kt b/src/main/kotlin/fr/shikkanime/repositories/AnimeRepository.kt index 3adbd19d..32780d0f 100644 --- a/src/main/kotlin/fr/shikkanime/repositories/AnimeRepository.kt +++ b/src/main/kotlin/fr/shikkanime/repositories/AnimeRepository.kt @@ -55,7 +55,7 @@ class AnimeRepository : AbstractRepository() { } query.orderBy(orders) - buildPageableQuery(entityManager.createQuery(query), page, limit) + buildPageableQuery(createReadOnlyQuery(entityManager, query), page, limit) } } diff --git a/src/main/kotlin/fr/shikkanime/repositories/EpisodeMappingRepository.kt b/src/main/kotlin/fr/shikkanime/repositories/EpisodeMappingRepository.kt index 0b1b8bc8..1602cd77 100644 --- a/src/main/kotlin/fr/shikkanime/repositories/EpisodeMappingRepository.kt +++ b/src/main/kotlin/fr/shikkanime/repositories/EpisodeMappingRepository.kt @@ -48,7 +48,7 @@ class EpisodeMappingRepository : AbstractRepository() { } query.orderBy(orders) - buildPageableQuery(entityManager.createQuery(query), page, limit) + buildPageableQuery(createReadOnlyQuery(entityManager, query), page, limit) } } diff --git a/src/main/kotlin/fr/shikkanime/repositories/EpisodeVariantRepository.kt b/src/main/kotlin/fr/shikkanime/repositories/EpisodeVariantRepository.kt index 4feed0db..e0ce281e 100644 --- a/src/main/kotlin/fr/shikkanime/repositories/EpisodeVariantRepository.kt +++ b/src/main/kotlin/fr/shikkanime/repositories/EpisodeVariantRepository.kt @@ -33,7 +33,7 @@ class EpisodeVariantRepository : AbstractRepository() { member?.let { val animePredicate = root[EpisodeVariant_.mapping][EpisodeMapping_.anime].get(Anime_.UUID).`in`( - memberFollowAnimeService.getAllFollowedAnimesUUID(it) + memberFollowAnimeService.findAllFollowedAnimesUUID(it) ) predicates.add(animePredicate) } diff --git a/src/main/kotlin/fr/shikkanime/repositories/MemberFollowAnimeRepository.kt b/src/main/kotlin/fr/shikkanime/repositories/MemberFollowAnimeRepository.kt index e2b1cae4..9f0f622e 100644 --- a/src/main/kotlin/fr/shikkanime/repositories/MemberFollowAnimeRepository.kt +++ b/src/main/kotlin/fr/shikkanime/repositories/MemberFollowAnimeRepository.kt @@ -1,6 +1,7 @@ package fr.shikkanime.repositories import fr.shikkanime.entities.* +import jakarta.persistence.Tuple import java.util.* class MemberFollowAnimeRepository : AbstractRepository() { @@ -23,7 +24,7 @@ class MemberFollowAnimeRepository : AbstractRepository() { } } - fun getAllFollowedAnimesUUID(member: Member): List { + fun findAllFollowedAnimesUUID(member: Member): List { return inTransaction { val cb = it.criteriaBuilder val query = cb.createQuery(UUID::class.java) @@ -38,4 +39,34 @@ class MemberFollowAnimeRepository : AbstractRepository() { .resultList } } + + fun findAllMissedAnimes( + member: Member, + watchedEpisodes: List, + page: Int, + limit: Int, + ): Pageable { + return inTransaction { entityManager -> + val cb = entityManager.criteriaBuilder + val query = cb.createQuery(Tuple::class.java) + val root = query.from(getEntityClass()) + + val subQuery = query.subquery(Long::class.java) + val subRoot = subQuery.from(EpisodeMapping::class.java) + subQuery.select(cb.count(subRoot)) + subQuery.where( + cb.equal(subRoot[EpisodeMapping_.anime], root[MemberFollowAnime_.anime]), + cb.not(subRoot.get(EpisodeMapping_.UUID).`in`(watchedEpisodes.map { it.uuid })) + ) + + query.select(cb.tuple(root[MemberFollowAnime_.anime], subQuery)) + query.where( + cb.equal(root[MemberFollowAnime_.member], member), + cb.greaterThan(subQuery, 0) + ) + + query.orderBy(cb.desc(root[MemberFollowAnime_.anime][Anime_.lastReleaseDateTime])) + buildPageableQuery(createReadOnlyQuery(entityManager, query), page, limit) + } + } } \ No newline at end of file diff --git a/src/main/kotlin/fr/shikkanime/repositories/MemberFollowEpisodeRepository.kt b/src/main/kotlin/fr/shikkanime/repositories/MemberFollowEpisodeRepository.kt index 0ade2a65..a3feb04d 100644 --- a/src/main/kotlin/fr/shikkanime/repositories/MemberFollowEpisodeRepository.kt +++ b/src/main/kotlin/fr/shikkanime/repositories/MemberFollowEpisodeRepository.kt @@ -6,29 +6,28 @@ import java.util.* class MemberFollowEpisodeRepository : AbstractRepository() { override fun getEntityClass() = MemberFollowEpisode::class.java - fun findByMemberAndEpisode(member: Member, episode: EpisodeMapping): MemberFollowEpisode? { + fun findAllFollowedEpisodesUUID(member: Member): List { return inTransaction { val cb = it.criteriaBuilder - val query = cb.createQuery(getEntityClass()) + val query = cb.createQuery(UUID::class.java) val root = query.from(getEntityClass()) + query.select(root[MemberFollowEpisode_.episode][EpisodeMapping_.UUID]) query.where( - cb.equal(root[MemberFollowEpisode_.member], member), - cb.equal(root[MemberFollowEpisode_.episode], episode) + cb.equal(root[MemberFollowEpisode_.member], member) ) createReadOnlyQuery(it, query) .resultList - .firstOrNull() } } - fun getAllFollowedEpisodesUUID(member: Member): List { + fun findAllFollowedEpisodes(member: Member): List { return inTransaction { val cb = it.criteriaBuilder - val query = cb.createQuery(UUID::class.java) + val query = cb.createQuery(EpisodeMapping::class.java) val root = query.from(getEntityClass()) - query.select(root[MemberFollowEpisode_.episode][EpisodeMapping_.UUID]) + query.select(root[MemberFollowEpisode_.episode]) query.where( cb.equal(root[MemberFollowEpisode_.member], member) @@ -39,6 +38,23 @@ class MemberFollowEpisodeRepository : AbstractRepository() } } + fun findByMemberAndEpisode(member: Member, episode: EpisodeMapping): MemberFollowEpisode? { + return inTransaction { + val cb = it.criteriaBuilder + val query = cb.createQuery(getEntityClass()) + val root = query.from(getEntityClass()) + + query.where( + cb.equal(root[MemberFollowEpisode_.member], member), + cb.equal(root[MemberFollowEpisode_.episode], episode) + ) + + createReadOnlyQuery(it, query) + .resultList + .firstOrNull() + } + } + fun getTotalDuration(member: Member): Long { return inTransaction { val cb = it.criteriaBuilder diff --git a/src/main/kotlin/fr/shikkanime/services/MemberFollowAnimeService.kt b/src/main/kotlin/fr/shikkanime/services/MemberFollowAnimeService.kt index 07f431d3..c69b5943 100644 --- a/src/main/kotlin/fr/shikkanime/services/MemberFollowAnimeService.kt +++ b/src/main/kotlin/fr/shikkanime/services/MemberFollowAnimeService.kt @@ -2,6 +2,7 @@ package fr.shikkanime.services import com.google.inject.Inject import fr.shikkanime.dtos.GenericDto +import fr.shikkanime.entities.EpisodeMapping import fr.shikkanime.entities.Member import fr.shikkanime.entities.MemberFollowAnime import fr.shikkanime.repositories.MemberFollowAnimeRepository @@ -22,7 +23,10 @@ class MemberFollowAnimeService : AbstractService, page: Int, limit: Int) = + memberFollowAnimeRepository.findAllMissedAnimes(member, watchedEpisodes, page, limit) fun follow(uuidUser: UUID, anime: GenericDto): Response { val member = memberService.find(uuidUser) ?: return Response.notFound() diff --git a/src/main/kotlin/fr/shikkanime/services/MemberFollowEpisodeService.kt b/src/main/kotlin/fr/shikkanime/services/MemberFollowEpisodeService.kt index 699f4b37..a432dae4 100644 --- a/src/main/kotlin/fr/shikkanime/services/MemberFollowEpisodeService.kt +++ b/src/main/kotlin/fr/shikkanime/services/MemberFollowEpisodeService.kt @@ -26,7 +26,9 @@ class MemberFollowEpisodeService : AbstractService>( + classes = listOf( + MemberFollowAnime::class.java, + MemberFollowEpisode::class.java + ), + ) { + val member = memberCacheService.find(it.uuid) ?: return@MapCache PageableDto.empty() + val pageable = memberFollowAnimeService.findAllMissedAnimes( + member, + memberFollowEpisodeService.findAllFollowedEpisodes(member), + it.page, + it.limit + ) + + val dtos = pageable.data.map { tuple -> + MissedAnimeDto( + AbstractConverter.convert(tuple[0], AnimeDto::class.java), + tuple[1] as Long + ) + } + + PageableDto( + data = dtos, + page = pageable.page, + limit = pageable.limit, + total = pageable.total, + ) + } + + fun getMissedAnimes(member: UUID, page: Int, limit: Int) = cache[UUIDPaginationKeyCache(member, page, limit)] +} \ No newline at end of file diff --git a/src/test/kotlin/fr/shikkanime/controllers/api/AnimeControllerTest.kt b/src/test/kotlin/fr/shikkanime/controllers/api/AnimeControllerTest.kt index f1ac9f07..5441aa0a 100644 --- a/src/test/kotlin/fr/shikkanime/controllers/api/AnimeControllerTest.kt +++ b/src/test/kotlin/fr/shikkanime/controllers/api/AnimeControllerTest.kt @@ -1,9 +1,8 @@ package fr.shikkanime.controllers.api +import com.google.gson.reflect.TypeToken import com.google.inject.Inject -import fr.shikkanime.dtos.GenericDto -import fr.shikkanime.dtos.MemberDto -import fr.shikkanime.dtos.WeeklyAnimesDto +import fr.shikkanime.dtos.* import fr.shikkanime.entities.Anime import fr.shikkanime.entities.EpisodeMapping import fr.shikkanime.entities.EpisodeVariant @@ -158,7 +157,7 @@ class AnimeControllerTest { }.apply { assertEquals(HttpStatusCode.OK, status) val findPrivateMember = memberService.findPrivateMember(identifier) - val followedAnimesUUID = memberFollowAnimeService.getAllFollowedAnimesUUID(findPrivateMember!!) + val followedAnimesUUID = memberFollowAnimeService.findAllFollowedAnimesUUID(findPrivateMember!!) assertNotNull(findPrivateMember) assertEquals(1, followedAnimesUUID.size) assertEquals(anime1.uuid, followedAnimesUUID.first()) @@ -185,4 +184,75 @@ class AnimeControllerTest { } } } + + @Test + fun getMissedAnimes() { + testApplication { + application { + module() + } + + val (identifier, token) = registerAndLogin() + + val anime = animeService.save( + Anime( + countryCode = CountryCode.FR, + name = "Test Anime 1", + image = "test.jpg", + slug = "test-anime-1", + banner = "test-banner.jpg", + description = "Test description", + ) + ) + + val episodes = (1..12).map { + episodeMappingService.save( + EpisodeMapping( + anime = anime, + episodeType = EpisodeType.EPISODE, + season = 1, + number = it, + image = "test.jpg", + ) + ) + } + + client.put("/api/v1/members/animes") { + header(HttpHeaders.Authorization, "Bearer $token") + header(HttpHeaders.ContentType, ContentType.Application.Json.toString()) + setBody(ObjectParser.toJson(GenericDto(anime.uuid!!))) + }.apply { + assertEquals(HttpStatusCode.OK, status) + val findPrivateMember = memberService.findPrivateMember(identifier) + val followedAnimesUUID = memberFollowAnimeService.findAllFollowedAnimesUUID(findPrivateMember!!) + assertNotNull(findPrivateMember) + assertEquals(1, followedAnimesUUID.size) + assertEquals(anime.uuid, followedAnimesUUID.first()) + } + + client.put("/api/v1/members/episodes") { + header(HttpHeaders.Authorization, "Bearer $token") + header(HttpHeaders.ContentType, ContentType.Application.Json.toString()) + setBody(ObjectParser.toJson(GenericDto(episodes.first().uuid!!))) + }.apply { + assertEquals(HttpStatusCode.OK, status) + val findPrivateMember = memberService.findPrivateMember(identifier) + val followedEpisodesUUID = memberFollowEpisodeService.findAllFollowedEpisodesUUID(findPrivateMember!!) + assertNotNull(findPrivateMember) + assertEquals(1, followedEpisodesUUID.size) + assertEquals(episodes.first().uuid, followedEpisodesUUID.first()) + } + + client.get("/api/v1/animes/missed?page=1&limit=8") { + header(HttpHeaders.Authorization, "Bearer $token") + header(HttpHeaders.ContentType, ContentType.Application.Json.toString()) + }.apply { + assertEquals(HttpStatusCode.OK, status) + val missedAnimes = + ObjectParser.fromJson(bodyAsText(), object : TypeToken>() {}) + assertEquals(1, missedAnimes.data.size) + assertEquals(11, missedAnimes.data.first().episodeMissed) + } + } + } } \ No newline at end of file diff --git a/src/test/kotlin/fr/shikkanime/controllers/api/MemberControllerTest.kt b/src/test/kotlin/fr/shikkanime/controllers/api/MemberControllerTest.kt index 1e865cf9..b3ec1f04 100644 --- a/src/test/kotlin/fr/shikkanime/controllers/api/MemberControllerTest.kt +++ b/src/test/kotlin/fr/shikkanime/controllers/api/MemberControllerTest.kt @@ -146,7 +146,7 @@ class MemberControllerTest { }.apply { assertEquals(HttpStatusCode.OK, status) val findPrivateMember = memberService.findPrivateMember(identifier) - val followedAnimesUUID = memberFollowAnimeService.getAllFollowedAnimesUUID(findPrivateMember!!) + val followedAnimesUUID = memberFollowAnimeService.findAllFollowedAnimesUUID(findPrivateMember!!) assertNotNull(findPrivateMember) assertEquals(1, followedAnimesUUID.size) assertEquals(anime.uuid, followedAnimesUUID.first()) @@ -200,7 +200,7 @@ class MemberControllerTest { }.apply { assertEquals(HttpStatusCode.OK, status) val findPrivateMember = memberService.findPrivateMember(identifier) - val followedAnimesUUID = memberFollowAnimeService.getAllFollowedAnimesUUID(findPrivateMember!!) + val followedAnimesUUID = memberFollowAnimeService.findAllFollowedAnimesUUID(findPrivateMember!!) assertNotNull(findPrivateMember) assertEquals(1, followedAnimesUUID.size) assertEquals(anime.uuid, followedAnimesUUID.first()) @@ -213,7 +213,7 @@ class MemberControllerTest { }.apply { assertEquals(HttpStatusCode.OK, status) val findPrivateMember = memberService.findPrivateMember(identifier) - val followedAnimesUUID = memberFollowAnimeService.getAllFollowedAnimesUUID(findPrivateMember!!) + val followedAnimesUUID = memberFollowAnimeService.findAllFollowedAnimesUUID(findPrivateMember!!) assertNotNull(findPrivateMember) assertEquals(0, followedAnimesUUID.size) } @@ -257,7 +257,7 @@ class MemberControllerTest { }.apply { assertEquals(HttpStatusCode.OK, status) val findPrivateMember = memberService.findPrivateMember(identifier) - val followedEpisodesUUID = memberFollowEpisodeService.getAllFollowedEpisodesUUID(findPrivateMember!!) + val followedEpisodesUUID = memberFollowEpisodeService.findAllFollowedEpisodesUUID(findPrivateMember!!) assertNotNull(findPrivateMember) assertEquals(1, followedEpisodesUUID.size) assertEquals(episode.uuid, followedEpisodesUUID.first()) @@ -321,7 +321,7 @@ class MemberControllerTest { }.apply { assertEquals(HttpStatusCode.OK, status) val findPrivateMember = memberService.findPrivateMember(identifier) - val followedEpisodesUUID = memberFollowEpisodeService.getAllFollowedEpisodesUUID(findPrivateMember!!) + val followedEpisodesUUID = memberFollowEpisodeService.findAllFollowedEpisodesUUID(findPrivateMember!!) assertNotNull(findPrivateMember) assertEquals(1, followedEpisodesUUID.size) assertEquals(episode.uuid, followedEpisodesUUID.first()) @@ -334,7 +334,7 @@ class MemberControllerTest { }.apply { assertEquals(HttpStatusCode.OK, status) val findPrivateMember = memberService.findPrivateMember(identifier) - val followedEpisodes = memberFollowEpisodeService.getAllFollowedEpisodesUUID(findPrivateMember!!) + val followedEpisodes = memberFollowEpisodeService.findAllFollowedEpisodesUUID(findPrivateMember!!) assertNotNull(findPrivateMember) assertEquals(0, followedEpisodes.size) } @@ -380,7 +380,7 @@ class MemberControllerTest { }.apply { assertEquals(HttpStatusCode.OK, status) val findPrivateMember = memberService.findPrivateMember(identifier) - val followedEpisodes = memberFollowEpisodeService.getAllFollowedEpisodesUUID(findPrivateMember!!) + val followedEpisodes = memberFollowEpisodeService.findAllFollowedEpisodesUUID(findPrivateMember!!) assertNotNull(findPrivateMember) assertEquals(12, followedEpisodes.size) }