Skip to content

Commit

Permalink
v2.0.7 (#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
char-yb authored Dec 12, 2024
2 parents c85bc0c + 2a42726 commit 0512f7c
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 55 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/develop_build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ jobs:
environment: DEV
strategy:
matrix:
java-version: [ 17 ]
java-version: [ 21 ]
distribution: [ 'temurin' ]

steps:
# 기본 체크아웃
- 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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/develop_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/production_build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ jobs:
environment: PROD
strategy:
matrix:
java-version: [ 17 ]
java-version: [ 21 ]
distribution: [ 'temurin' ]

steps:
# 기본 체크아웃
- 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 }}
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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'
}
Expand All @@ -11,7 +11,7 @@ group = 'com.depromeet'
version = '0.0.1-SNAPSHOT'

java {
sourceCompatibility = '17'
sourceCompatibility = '21'
}

configurations {
Expand All @@ -27,7 +27,7 @@ repositories {
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.7.0'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'
Expand Down Expand Up @@ -130,7 +130,7 @@ sonar {
}

jacoco {
toolVersion = "0.8.8"
toolVersion = "0.8.12"
}

jacocoTestReport {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -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/.
Expand Down Expand Up @@ -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
Expand Down
22 changes: 12 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##########################################################################
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ public PasswordEncoder passwordEncoder() {

@Bean
@Order(1)
@ConditionalOnProfile({DEV, LOCAL})
@ConditionalOnProfile({PROD, DEV, LOCAL})
public SecurityFilterChain swaggerFilterChain(HttpSecurity http) throws Exception {
defaultFilterChain(http);

http.securityMatcher(getSwaggerUrls()).httpBasic(withDefaults());

http.authorizeHttpRequests(
springEnvironmentUtil.isDevProfile()
(springEnvironmentUtil.isDevProfile() || springEnvironmentUtil.isProdProfile())
? authorize -> authorize.anyRequest().authenticated()
: authorize -> authorize.anyRequest().permitAll());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,11 @@ private List<Server> swaggerServers() {
}

private String getServerUrl() {
switch (springEnvironmentUtil.getCurrentProfile()) {
case "prod":
return UrlConstants.PROD_SERVER_URL.getValue();
case "dev":
return UrlConstants.DEV_SERVER_URL.getValue();
default:
return UrlConstants.LOCAL_SERVER_URL.getValue();
}
return switch (springEnvironmentUtil.getCurrentProfile()) {
case "prod" -> UrlConstants.PROD_SERVER_URL.getValue();
case "dev" -> UrlConstants.DEV_SERVER_URL.getValue();
default -> UrlConstants.LOCAL_SERVER_URL.getValue();
};
}

private Components authSetting() {
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ spring:
- redis
- storage
- security
threads:
virtual:
enabled: true

swagger:
version: ${SWAGGER_VERSION:default}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 팔로우를_추가할_때 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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을_생성할_때 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@
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")
class NotificationServiceTest {

@Autowired private MemberUtil memberUtil;

@MockBean private FcmService fcmService;
@MockitoBean private FcmService fcmService;

@Autowired private MissionRepository missionRepository;

Expand Down

0 comments on commit 0512f7c

Please sign in to comment.