diff --git a/.github/workflows/develop_build_deploy.yml b/.github/workflows/develop_build_deploy.yml index 07368e2d5..070b64247 100644 --- a/.github/workflows/develop_build_deploy.yml +++ b/.github/workflows/develop_build_deploy.yml @@ -14,7 +14,7 @@ jobs: environment: DEV strategy: matrix: - java-version: [ 17 ] + java-version: [ 21 ] distribution: [ 'temurin' ] steps: @@ -22,8 +22,8 @@ jobs: - name: Checkout uses: actions/checkout@v3 - # JDK를 17 버전으로 세팅 - - name: Set up JDK 17 + # JDK를 21 버전으로 세팅 + - name: Set up JDK 21 uses: actions/setup-java@v3 with: java-version: ${{ matrix.java-version }} diff --git a/.github/workflows/develop_pull_request.yml b/.github/workflows/develop_pull_request.yml index 32f005de1..cee57a685 100644 --- a/.github/workflows/develop_pull_request.yml +++ b/.github/workflows/develop_pull_request.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java-version: [ 17 ] + java-version: [ 21 ] steps: - name: Checkout code uses: actions/checkout@v3 diff --git a/.github/workflows/production_build_deploy.yml b/.github/workflows/production_build_deploy.yml index 75de420b7..06bcfdd5f 100644 --- a/.github/workflows/production_build_deploy.yml +++ b/.github/workflows/production_build_deploy.yml @@ -15,7 +15,7 @@ jobs: environment: PROD strategy: matrix: - java-version: [ 17 ] + java-version: [ 21 ] distribution: [ 'temurin' ] steps: @@ -23,8 +23,8 @@ jobs: - name: Checkout uses: actions/checkout@v3 - # JDK를 17 버전으로 세팅 - - name: Set up JDK 17 + # JDK를 21 버전으로 세팅 + - name: Set up JDK 21 uses: actions/setup-java@v3 with: java-version: ${{ matrix.java-version }} diff --git a/Dockerfile b/Dockerfile index b54d10e7a..7bd83b0fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:17 +FROM amazoncorretto:21-alpine-jdk ARG JAR_FILE=build/libs/*.jar COPY ${JAR_FILE} app.jar -ENTRYPOINT ["java","-jar","/app.jar"] +ENTRYPOINT ["java", "-XX:+UseZGC", "-XX:+ZGenerational", "-jar", "/app.jar"] diff --git a/build.gradle b/build.gradle index a94673618..7a945fb98 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,8 @@ plugins { id 'java' - id 'org.springframework.boot' version '3.1.5' - id 'io.spring.dependency-management' version '1.1.3' - id 'com.diffplug.spotless' version '6.11.0' + id 'org.springframework.boot' version '3.4.0' + id 'io.spring.dependency-management' version '1.1.6' + id 'com.diffplug.spotless' version '6.21.0' id 'jacoco' id 'org.sonarqube' version '4.4.1.3373' } @@ -11,7 +11,7 @@ group = 'com.depromeet' version = '0.0.1-SNAPSHOT' java { - sourceCompatibility = '17' + sourceCompatibility = '21' } configurations { @@ -130,7 +130,7 @@ sonar { } jacoco { - toolVersion = "0.8.8" + toolVersion = "0.8.12" } jacocoTestReport { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7f93135c4..a4b76b953 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3fa8f862f..9355b4155 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.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a426..f5feea6d6 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,8 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/gradlew.bat b/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 9c76efd69..50c726a46 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -9,6 +9,9 @@ spring: - redis - storage - security + threads: + virtual: + enabled: true swagger: version: ${SWAGGER_VERSION:default} diff --git a/src/test/java/com/depromeet/domain/follow/api/FollowControllerTest.java b/src/test/java/com/depromeet/domain/follow/api/FollowControllerTest.java index 718e4422d..40ea25ab6 100644 --- a/src/test/java/com/depromeet/domain/follow/api/FollowControllerTest.java +++ b/src/test/java/com/depromeet/domain/follow/api/FollowControllerTest.java @@ -1,6 +1,5 @@ package com.depromeet.domain.follow.api; -import static org.junit.jupiter.api.Assertions.*; import static org.springframework.http.MediaType.APPLICATION_JSON; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; @@ -17,18 +16,16 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.data.jpa.mapping.JpaMetamodelMappingContext; import org.springframework.http.HttpStatus; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.test.web.servlet.MockMvc; @WebMvcTest(FollowController.class) @AutoConfigureMockMvc(addFilters = false) -@MockBean({JpaMetamodelMappingContext.class}) class FollowControllerTest { @Autowired private MockMvc mockMvc; @Autowired private ObjectMapper objectMapper; - @MockBean private FollowService followService; + @MockitoBean private FollowService followService; @Nested class 팔로우를_추가할_때 { diff --git a/src/test/java/com/depromeet/domain/image/api/ImageControllerTest.java b/src/test/java/com/depromeet/domain/image/api/ImageControllerTest.java index 8c43d1dab..13786123a 100644 --- a/src/test/java/com/depromeet/domain/image/api/ImageControllerTest.java +++ b/src/test/java/com/depromeet/domain/image/api/ImageControllerTest.java @@ -19,18 +19,16 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.data.jpa.mapping.JpaMetamodelMappingContext; import org.springframework.http.HttpStatus; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.test.web.servlet.MockMvc; @WebMvcTest(ImageController.class) @AutoConfigureMockMvc(addFilters = false) -@MockBean({JpaMetamodelMappingContext.class}) class ImageControllerTest { @Autowired private MockMvc mockMvc; @Autowired private ObjectMapper objectMapper; - @MockBean private ImageService imageService; + @MockitoBean private ImageService imageService; @Nested class 미션_기록_이미지_PresignedUrl을_생성할_때 { diff --git a/src/test/java/com/depromeet/domain/mission/controller/MissionControllerTest.java b/src/test/java/com/depromeet/domain/mission/controller/MissionControllerTest.java index 4dd2337bf..96dd3f314 100644 --- a/src/test/java/com/depromeet/domain/mission/controller/MissionControllerTest.java +++ b/src/test/java/com/depromeet/domain/mission/controller/MissionControllerTest.java @@ -31,20 +31,18 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.data.jpa.mapping.JpaMetamodelMappingContext; import org.springframework.http.HttpStatus; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.ResultActions; @WebMvcTest(MissionController.class) @AutoConfigureMockMvc(addFilters = false) -@MockBean({JpaMetamodelMappingContext.class}) class MissionControllerTest { @Autowired private MockMvc mockMvc; @Autowired private ObjectMapper objectMapper; - @MockBean private MissionService missionService; + @MockitoBean private MissionService missionService; @Test void 공부미션을_생성한다() throws Exception { diff --git a/src/test/java/com/depromeet/domain/missionRecord/application/MissionRecordServiceTest.java b/src/test/java/com/depromeet/domain/missionRecord/application/MissionRecordServiceTest.java index 981af4324..9e03f36d3 100644 --- a/src/test/java/com/depromeet/domain/missionRecord/application/MissionRecordServiceTest.java +++ b/src/test/java/com/depromeet/domain/missionRecord/application/MissionRecordServiceTest.java @@ -27,8 +27,8 @@ import org.junit.jupiter.api.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.bean.override.mockito.MockitoBean; @SpringBootTest @ActiveProfiles("test") @@ -42,7 +42,7 @@ class MissionRecordServiceTest { @Autowired MissionRepository missionRepository; @Autowired MissionRecordRepository missionRecordRepository; @Autowired ReactionRepository reactionRepository; - @MockBean SecurityUtil securityUtil; + @MockitoBean SecurityUtil securityUtil; private Member member; private Mission mission; diff --git a/src/test/java/com/depromeet/domain/notification/application/NotificationServiceTest.java b/src/test/java/com/depromeet/domain/notification/application/NotificationServiceTest.java index a478041dd..5a012bd41 100644 --- a/src/test/java/com/depromeet/domain/notification/application/NotificationServiceTest.java +++ b/src/test/java/com/depromeet/domain/notification/application/NotificationServiceTest.java @@ -32,11 +32,11 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.bean.override.mockito.MockitoBean; @SpringBootTest @ActiveProfiles("test") @@ -44,7 +44,7 @@ class NotificationServiceTest { @Autowired private MemberUtil memberUtil; - @MockBean private FcmService fcmService; + @MockitoBean private FcmService fcmService; @Autowired private MissionRepository missionRepository;