From d05cb0cd8fcd452c8e483d7f154cbf3468c7a2a7 Mon Sep 17 00:00:00 2001 From: choidongkuen Date: Sat, 13 Jan 2024 09:16:45 +0900 Subject: [PATCH 01/10] =?UTF-8?q?refactor:=20JwtService=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=9E=AC=EC=A0=95=EB=A0=AC=20(#40)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/net/teumteum/core/security/service/JwtService.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/net/teumteum/core/security/service/JwtService.java b/src/main/java/net/teumteum/core/security/service/JwtService.java index ad0ca8fe..80243885 100644 --- a/src/main/java/net/teumteum/core/security/service/JwtService.java +++ b/src/main/java/net/teumteum/core/security/service/JwtService.java @@ -61,7 +61,6 @@ public TokenResponse createServiceToken(User users) { this.jwtProperty.getRefresh().getExpiration()); return new TokenResponse(jwtProperty.getBearer() + " " + accessToken, refreshToken); - } public String createAccessToken(String payload) { @@ -70,7 +69,6 @@ public String createAccessToken(String payload) { public String createRefreshToken() { return this.createToken(UUID.randomUUID().toString(), jwtProperty.getRefresh().getExpiration()); - } private String createToken(String payload, Long tokenExpiration) { From 0642f2ad98f61924c8b8601fbab0940efc1e4758 Mon Sep 17 00:00:00 2001 From: choidongkuen Date: Sat, 13 Jan 2024 09:17:47 +0900 Subject: [PATCH 02/10] =?UTF-8?q?refactor:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20import=20=EB=85=B8=EC=B6=9C=20=EC=A0=9C=EA=B1=B0=20?= =?UTF-8?q?(#42)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/net/teumteum/auth/service/OAuthService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/teumteum/auth/service/OAuthService.java b/src/main/java/net/teumteum/auth/service/OAuthService.java index 537b6c34..c1e7bb9a 100644 --- a/src/main/java/net/teumteum/auth/service/OAuthService.java +++ b/src/main/java/net/teumteum/auth/service/OAuthService.java @@ -67,9 +67,9 @@ private OAuthUserInfo getOAuthUserInfo(ClientRegistration clientRegistration, Au private TokenResponse checkUserAndMakeResponse(OAuthUserInfo oAuthUserInfo, Authenticated authenticated) { String oauthId = oAuthUserInfo.getOAuthId(); - java.util.Optional user = getUser(oauthId, authenticated); + java.util.Optional user = getUser(oauthId, authenticated); if (user.isEmpty()) { - return new net.teumteum.auth.domain.response.TokenResponse(oAuthUserInfo.getOAuthId()); + return new TokenResponse(oAuthUserInfo.getOAuthId()); } return jwtService.createServiceToken(user.get()); } From ef66858cddf36ea25eed46fb967a48df5bc78d61 Mon Sep 17 00:00:00 2001 From: choidongkuen Date: Sat, 13 Jan 2024 09:18:22 +0900 Subject: [PATCH 03/10] =?UTF-8?q?refactor:=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=9E=AC=EC=A0=95=EB=A0=AC=20(#42)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../net/teumteum/core/security/service/SecurityService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/teumteum/core/security/service/SecurityService.java b/src/main/java/net/teumteum/core/security/service/SecurityService.java index c4014664..a8375c6d 100644 --- a/src/main/java/net/teumteum/core/security/service/SecurityService.java +++ b/src/main/java/net/teumteum/core/security/service/SecurityService.java @@ -9,6 +9,7 @@ @Service @RequiredArgsConstructor public class SecurityService { + private final UserConnector userConnector; public static void clearSecurityContext() { @@ -21,7 +22,8 @@ private UserAuthentication getUserAuthentication() { public Long getCurrentUserId() { - return getUserAuthentication() == null ? userConnector.findAllUser().get(0).getId() : getUserAuthentication().getId(); + return getUserAuthentication() == null ? userConnector.findAllUser().get(0).getId() + : getUserAuthentication().getId(); } From 6591b6d6ce3bdc5a79dbdc14c6ce1f548f5553a0 Mon Sep 17 00:00:00 2001 From: choidongkuen Date: Sat, 13 Jan 2024 09:18:38 +0900 Subject: [PATCH 04/10] =?UTF-8?q?feat:=20=ED=9A=8C=EC=9B=90=ED=83=88?= =?UTF-8?q?=ED=87=B4=20API=20=EA=B5=AC=ED=98=84=20(#42)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../teumteum/user/controller/UserController.java | 8 ++++++++ .../java/net/teumteum/user/service/UserService.java | 13 +++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/main/java/net/teumteum/user/controller/UserController.java b/src/main/java/net/teumteum/user/controller/UserController.java index bc500a99..c1afbee9 100644 --- a/src/main/java/net/teumteum/user/controller/UserController.java +++ b/src/main/java/net/teumteum/user/controller/UserController.java @@ -14,6 +14,7 @@ import net.teumteum.user.service.UserService; import org.springframework.context.ApplicationContext; import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -73,6 +74,13 @@ public InterestQuestionResponse getInterestQuestion(@RequestParam("user-id") Lis return userService.getInterestQuestionByUserIds(userIds); } + @DeleteMapping("/withdraw") + @ResponseStatus(HttpStatus.OK) + public void withdraw() { + userService.withdraw(getCurrentUserId()); + } + + @ResponseStatus(HttpStatus.BAD_REQUEST) @ExceptionHandler(IllegalArgumentException.class) public ErrorResponse handleIllegalArgumentException(IllegalArgumentException illegalArgumentException) { diff --git a/src/main/java/net/teumteum/user/service/UserService.java b/src/main/java/net/teumteum/user/service/UserService.java index 99e0447a..0309d335 100644 --- a/src/main/java/net/teumteum/user/service/UserService.java +++ b/src/main/java/net/teumteum/user/service/UserService.java @@ -2,6 +2,7 @@ import java.util.List; import lombok.RequiredArgsConstructor; +import net.teumteum.core.security.service.RedisService; import net.teumteum.user.domain.InterestQuestion; import net.teumteum.user.domain.User; import net.teumteum.user.domain.UserRepository; @@ -21,6 +22,7 @@ public class UserService { private final UserRepository userRepository; private final InterestQuestion interestQuestion; + private final RedisService redisService; public UserGetResponse getUserById(Long userId) { var existUser = getUser(userId); @@ -56,6 +58,13 @@ public void addFriends(Long myId, Long friendId) { me.addFriend(friend); } + @Transactional + public void withdraw(Long userId) { + var existUser = getUser(userId); + deleteUser(existUser); + redisService.deleteData(String.valueOf(userId)); + } + public FriendsResponse findFriendsByUserId(Long userId) { var user = getUser(userId); var friends = userRepository.findAllById(user.getFriends()); @@ -78,4 +87,8 @@ public InterestQuestionResponse getInterestQuestionByUserIds(List userIds) return interestQuestion.getQuestion(users); } + + private void deleteUser(User user) { + this.userRepository.delete(user); + } } From fa7fd17df9080b106f4bef07f37662e7e083866e Mon Sep 17 00:00:00 2001 From: choidongkuen Date: Sat, 13 Jan 2024 09:26:24 +0900 Subject: [PATCH 05/10] =?UTF-8?q?test:=20=ED=9A=8C=EC=9B=90=ED=83=88?= =?UTF-8?q?=ED=87=B4=20=ED=86=B5=ED=95=A9=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20(#42)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/net/teumteum/integration/Api.java | 7 +++++++ .../integration/UserIntegrationTest.java | 20 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/test/java/net/teumteum/integration/Api.java b/src/test/java/net/teumteum/integration/Api.java index cf3711fd..c5439aa7 100644 --- a/src/test/java/net/teumteum/integration/Api.java +++ b/src/test/java/net/teumteum/integration/Api.java @@ -126,4 +126,11 @@ ResponseSpec reissueJwt(String accessToken, String refreshToken) { .header("Authorization-refresh", refreshToken) .exchange(); } + + ResponseSpec withdrawUser(String accessToken) { + return webTestClient.delete() + .uri("/users/withdraw") + .header(HttpHeaders.AUTHORIZATION, accessToken) + .exchange(); + } } diff --git a/src/test/java/net/teumteum/integration/UserIntegrationTest.java b/src/test/java/net/teumteum/integration/UserIntegrationTest.java index b332f452..2db93876 100644 --- a/src/test/java/net/teumteum/integration/UserIntegrationTest.java +++ b/src/test/java/net/teumteum/integration/UserIntegrationTest.java @@ -194,4 +194,24 @@ void Return_empty_friends_when_received_empty_friends_user_id() { .usingRecursiveComparison().isEqualTo(expected); } } + + @Nested + @DisplayName("회원 탈퇴 API는") + class Withdraw_user { + + @Test + @DisplayName("현재 로그인한 회원의 회원 탈퇴를 전상적으로 진행한다.") + void Return_200_ok_when_withdraw_current_user() { + // given + var me = repository.saveAndGetUser(); + + loginContext.setUserId(me.getId()); + + // when + var result = api.withdrawUser(VALID_TOKEN); + + // then + Assertions.assertThat(result.expectStatus().isOk()); + } + } } From a54d8d64ed617ebcbf98fcffddaafadb96940b47 Mon Sep 17 00:00:00 2001 From: choidongkuen Date: Sat, 13 Jan 2024 09:32:38 +0900 Subject: [PATCH 06/10] =?UTF-8?q?refactor:=20SecurityConfig=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=9E=AC=EC=A0=95=EB=A0=AC=20(#42)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/security/SecurityConfig.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/main/java/net/teumteum/core/security/SecurityConfig.java b/src/main/java/net/teumteum/core/security/SecurityConfig.java index eedd5574..d5250309 100644 --- a/src/main/java/net/teumteum/core/security/SecurityConfig.java +++ b/src/main/java/net/teumteum/core/security/SecurityConfig.java @@ -1,6 +1,8 @@ package net.teumteum.core.security; +import static org.springframework.security.config.http.SessionCreationPolicy.STATELESS; + import lombok.RequiredArgsConstructor; import net.teumteum.core.security.filter.JwtAccessDeniedHandler; import net.teumteum.core.security.filter.JwtAuthenticationEntryPoint; @@ -15,8 +17,6 @@ import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; -import static org.springframework.security.config.http.SessionCreationPolicy.STATELESS; - @Configuration @EnableWebSecurity @RequiredArgsConstructor @@ -34,20 +34,20 @@ public WebSecurityCustomizer webSecurityCustomizer() { @Bean SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { http.csrf(AbstractHttpConfigurer::disable) - .cors(Customizer.withDefaults()) - .authorizeHttpRequests( - request -> request.requestMatchers("/**").permitAll() - .anyRequest().authenticated()) - .httpBasic(AbstractHttpConfigurer::disable) - .formLogin(AbstractHttpConfigurer::disable) - .sessionManagement(sessionManagement -> sessionManagement.sessionCreationPolicy(STATELESS)) - .exceptionHandling( - exceptionHandling -> - exceptionHandling - .authenticationEntryPoint(jwtAuthenticationEntryPoint) - .accessDeniedHandler(accessDeniedHandler) - ) - .addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class); + .cors(Customizer.withDefaults()) + .authorizeHttpRequests( + request -> request.requestMatchers("/**").permitAll() + .anyRequest().authenticated()) + .httpBasic(AbstractHttpConfigurer::disable) + .formLogin(AbstractHttpConfigurer::disable) + .sessionManagement(sessionManagement -> sessionManagement.sessionCreationPolicy(STATELESS)) + .exceptionHandling( + exceptionHandling -> + exceptionHandling + .authenticationEntryPoint(jwtAuthenticationEntryPoint) + .accessDeniedHandler(accessDeniedHandler) + ) + .addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class); return http.build(); } } From 3f21c78c7d691d44b277b3780099149a27fdc586 Mon Sep 17 00:00:00 2001 From: choidongkuen Date: Sat, 13 Jan 2024 09:39:55 +0900 Subject: [PATCH 07/10] =?UTF-8?q?refactor:=20=EA=B8=B0=ED=83=80=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EB=A6=AC=ED=8C=A9=ED=86=A0=EB=A7=81=20(#4?= =?UTF-8?q?2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../net/teumteum/auth/domain/response/TokenResponse.java | 9 +++++---- .../net/teumteum/core/security/service/JwtService.java | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/teumteum/auth/domain/response/TokenResponse.java b/src/main/java/net/teumteum/auth/domain/response/TokenResponse.java index f4898a9b..77737034 100644 --- a/src/main/java/net/teumteum/auth/domain/response/TokenResponse.java +++ b/src/main/java/net/teumteum/auth/domain/response/TokenResponse.java @@ -1,25 +1,26 @@ package net.teumteum.auth.domain.response; import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; @Getter @NoArgsConstructor @JsonInclude(JsonInclude.Include.NON_NULL) -public class TokenResponse{ +public class TokenResponse { private String accessToken; private String refreshToken; private String oauthId; - @lombok.Builder - public TokenResponse(String accessToken, String refreshToken){ + @Builder + public TokenResponse(String accessToken, String refreshToken) { this.accessToken = accessToken; this.refreshToken = refreshToken; } - public TokenResponse(String oauthId){ + public TokenResponse(String oauthId) { this.oauthId = oauthId; } diff --git a/src/main/java/net/teumteum/core/security/service/JwtService.java b/src/main/java/net/teumteum/core/security/service/JwtService.java index 80243885..4ecb9776 100644 --- a/src/main/java/net/teumteum/core/security/service/JwtService.java +++ b/src/main/java/net/teumteum/core/security/service/JwtService.java @@ -96,5 +96,4 @@ public boolean validateToken(String token) { } return false; } - } From 33a04d7f0d7a1cddd551c2d77d2bb6932338298f Mon Sep 17 00:00:00 2001 From: choidongkuen Date: Sat, 13 Jan 2024 09:43:28 +0900 Subject: [PATCH 08/10] =?UTF-8?q?fix:=20CI=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20(#42)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../integration/AuthIntegrationTest.java | 35 ------------------- 1 file changed, 35 deletions(-) delete mode 100644 src/test/java/net/teumteum/integration/AuthIntegrationTest.java diff --git a/src/test/java/net/teumteum/integration/AuthIntegrationTest.java b/src/test/java/net/teumteum/integration/AuthIntegrationTest.java deleted file mode 100644 index a2f53fd2..00000000 --- a/src/test/java/net/teumteum/integration/AuthIntegrationTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package net.teumteum.integration; - -import net.teumteum.auth.domain.response.TokenResponse; -import net.teumteum.user.domain.User; -import org.assertj.core.api.Assertions; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Nested; -import org.junit.jupiter.api.Test; - -@DisplayName("인증 통합테스트의") -public class AuthIntegrationTest extends IntegrationTest { - - private static final String VALID_ACCESS_TOKEN = "VALID_ACCESS_TOKEN"; - private static final String INVALID_ACCESS_TOKEN = "INVALID_ACCESS_TOKEN"; - private static final String VALID_REFRESH_TOKEN = "VALID_REFRESH_TOKEN"; - private static final String INVALID_REFRESH_TOKEN = "INVALID_REFRESH_TOKEN"; - - @Nested - @DisplayName("토큰 재발급 API는") - class ReIssue_jwt_api { - - @Test - @DisplayName("유효하지 않은 access token 과 유효한 refresh token 이 주어지면, 새로운 토큰을 발급한다.") - void Return_new_jwt_if_access_and_refresh_is_exist() { - // given - User user = repository.saveAndGetUser(); - // when - var result = api.reissueJwt(INVALID_ACCESS_TOKEN, VALID_REFRESH_TOKEN); - // then - Assertions.assertThat(result.expectBody(TokenResponse.class) - .returnResult() - .getResponseBody()); - } - } -} From 066df3038bc9a17e3df1f0a2ee3c2d9ed91bcb98 Mon Sep 17 00:00:00 2001 From: ChoiDongKuen Date: Sat, 13 Jan 2024 14:32:09 +0900 Subject: [PATCH 09/10] =?UTF-8?q?feat:=20Redis=20=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=ED=81=B4=EB=9E=98=EC=8A=A4=EB=A5=BC=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=ED=95=98=EA=B3=A0=20=EC=A0=81=EC=9A=A9?= =?UTF-8?q?=ED=95=9C=EB=8B=A4.=20(#51)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: 기존 코드 리팩토링 (#49) * feat: RedisConfig 구현 (#49) * fix: CI 에러 수정 (#49) --- .../teumteum/auth/service/OAuthService.java | 2 +- .../net/teumteum/core/config/RedisConfig.java | 32 +++++++++++++++++++ .../core/security/service/JwtService.java | 2 +- .../core/security/service/RedisService.java | 14 ++++---- src/test/resources/application.properties | 3 ++ 5 files changed, 44 insertions(+), 9 deletions(-) create mode 100644 src/main/java/net/teumteum/core/config/RedisConfig.java diff --git a/src/main/java/net/teumteum/auth/service/OAuthService.java b/src/main/java/net/teumteum/auth/service/OAuthService.java index c1e7bb9a..43dd8308 100644 --- a/src/main/java/net/teumteum/auth/service/OAuthService.java +++ b/src/main/java/net/teumteum/auth/service/OAuthService.java @@ -67,7 +67,7 @@ private OAuthUserInfo getOAuthUserInfo(ClientRegistration clientRegistration, Au private TokenResponse checkUserAndMakeResponse(OAuthUserInfo oAuthUserInfo, Authenticated authenticated) { String oauthId = oAuthUserInfo.getOAuthId(); - java.util.Optional user = getUser(oauthId, authenticated); + Optional user = getUser(oauthId, authenticated); if (user.isEmpty()) { return new TokenResponse(oAuthUserInfo.getOAuthId()); } diff --git a/src/main/java/net/teumteum/core/config/RedisConfig.java b/src/main/java/net/teumteum/core/config/RedisConfig.java new file mode 100644 index 00000000..2156023c --- /dev/null +++ b/src/main/java/net/teumteum/core/config/RedisConfig.java @@ -0,0 +1,32 @@ +package net.teumteum.core.config; + +import lombok.RequiredArgsConstructor; +import org.springframework.boot.autoconfigure.data.redis.RedisProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; + +@Configuration +@RequiredArgsConstructor +public class RedisConfig { + + private final RedisProperties redisProperties; + + @Bean + public RedisConnectionFactory redisConnectionFactory() { + return new LettuceConnectionFactory(redisProperties.getHost(), redisProperties.getPort()); + } + + @Bean + public RedisTemplate redisTemplate(RedisConnectionFactory redisConnectionFactory) { + RedisTemplate redisTemplate = new RedisTemplate<>(); + redisTemplate.setConnectionFactory(redisConnectionFactory); + redisTemplate.setKeySerializer(new StringRedisSerializer()); + redisTemplate.setValueSerializer(new Jackson2JsonRedisSerializer<>(Object.class)); + return redisTemplate; + } +} diff --git a/src/main/java/net/teumteum/core/security/service/JwtService.java b/src/main/java/net/teumteum/core/security/service/JwtService.java index 4ecb9776..76981daa 100644 --- a/src/main/java/net/teumteum/core/security/service/JwtService.java +++ b/src/main/java/net/teumteum/core/security/service/JwtService.java @@ -57,7 +57,7 @@ public TokenResponse createServiceToken(User users) { String accessToken = createAccessToken(String.valueOf(users.getId())); String refreshToken = createRefreshToken(); - this.redisService.setDataExpire(String.valueOf(users.getId()), refreshToken, + this.redisService.setDataWithExpiration(String.valueOf(users.getId()), refreshToken, this.jwtProperty.getRefresh().getExpiration()); return new TokenResponse(jwtProperty.getBearer() + " " + accessToken, refreshToken); diff --git a/src/main/java/net/teumteum/core/security/service/RedisService.java b/src/main/java/net/teumteum/core/security/service/RedisService.java index e252ff7a..a2e4cfcb 100644 --- a/src/main/java/net/teumteum/core/security/service/RedisService.java +++ b/src/main/java/net/teumteum/core/security/service/RedisService.java @@ -1,15 +1,15 @@ package net.teumteum.core.security.service; +import java.time.Duration; import lombok.RequiredArgsConstructor; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.ValueOperations; import org.springframework.stereotype.Service; -import java.time.Duration; - @Service @RequiredArgsConstructor public class RedisService { + private final StringRedisTemplate stringRedisTemplate; public String getData(String key) { @@ -22,16 +22,16 @@ public void setData(String key, String value) { valueOperations.set(key, value); } - public void deleteData(String key) { - this.stringRedisTemplate.delete(key); - } - - public void setDataExpire(String key, String value, Long duration) { + public void setDataWithExpiration(String key, String value, Long duration) { ValueOperations valueOperations = getStringStringValueOperations(); Duration expireDuration = Duration.ofSeconds(duration); valueOperations.set(key, value, expireDuration); } + public void deleteData(String key) { + this.stringRedisTemplate.delete(key); + } + private ValueOperations getStringStringValueOperations() { return this.stringRedisTemplate.opsForValue(); } diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties index 0d2a2040..8d270fe7 100644 --- a/src/test/resources/application.properties +++ b/src/test/resources/application.properties @@ -23,6 +23,9 @@ spring.security.oauth2.client.provider.kakao.authorization-uri=https://kauth.kak spring.security.oauth2.client.provider.kakao.token-uri=https://kauth.kakao.com/oauth/authorize spring.security.oauth2.client.provider.kakao.user-info-uri=https://kauth.kakao.com/oauth/authorize spring.security.oauth2.client.provider.kakao.user-name-attribute=https://kauth.kakao.com/oauth/authorize +### Redis ### +spring.data.redis.host=localhost +spring.data.redis.port=6379 From 94c42c5f3669138b9418f45e4a7d7fb9f5e1b747 Mon Sep 17 00:00:00 2001 From: choidongkuen Date: Sat, 13 Jan 2024 17:17:07 +0900 Subject: [PATCH 10/10] =?UTF-8?q?fix:=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=EB=AA=85=20=EB=B3=80=EA=B2=BD=20(#49)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/java/net/teumteum/integration/UserIntegrationTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/net/teumteum/integration/UserIntegrationTest.java b/src/test/java/net/teumteum/integration/UserIntegrationTest.java index 2db93876..6f237e45 100644 --- a/src/test/java/net/teumteum/integration/UserIntegrationTest.java +++ b/src/test/java/net/teumteum/integration/UserIntegrationTest.java @@ -200,7 +200,7 @@ void Return_empty_friends_when_received_empty_friends_user_id() { class Withdraw_user { @Test - @DisplayName("현재 로그인한 회원의 회원 탈퇴를 전상적으로 진행한다.") + @DisplayName("현재 로그인한 회원의 회원 탈퇴를 정상적으로 진행한다.") void Return_200_ok_when_withdraw_current_user() { // given var me = repository.saveAndGetUser();