From 731c673597b1ce66b4e29b6f79973fc421510150 Mon Sep 17 00:00:00 2001 From: splitCoding Date: Tue, 26 Sep 2023 17:27:03 +0900 Subject: [PATCH] =?UTF-8?q?style:=20=EB=A9=94=EC=84=9C=EB=93=9C=20?= =?UTF-8?q?=ED=98=B8=EC=B6=9C=EB=B6=80=20=EC=9D=B8=EC=9E=90=20=EC=A0=95?= =?UTF-8?q?=EB=A0=AC=20=EC=BB=A8=EB=B2=A4=EC=85=98=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?=EB=B0=8F=20=EC=84=B8=EB=B6=80=20=EC=BB=A8=EB=B2=A4=EC=85=98=20?= =?UTF-8?q?=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/shook/shook/auth/application/AuthService.java | 3 ++- .../shook/shook/auth/application/KakaoInfoProvider.java | 1 - .../auth/application/dto/KakaoMemberInfoResponse.java | 1 - .../main/java/shook/shook/auth/config/AuthConfig.java | 4 ++-- .../auth/ui/interceptor/LoginCheckerInterceptor.java | 5 +++-- .../auth/ui/interceptor/PathMatcherInterceptor.java | 9 +++++---- .../shook/auth/ui/interceptor/RequestPathPattern.java | 5 +++-- .../shook/shook/member/application/MemberService.java | 2 +- .../src/main/java/shook/shook/member/domain/Email.java | 2 -- .../shook/shook/song/application/dto/SongResponse.java | 2 +- .../repository/KillingPartLikeRepository.java | 2 +- .../shook/shook/voting_song/domain/VotingSongPart.java | 1 - .../shook/voting_song/ui/VotingSongPartController.java | 1 - .../src/test/java/shook/shook/ShookApplicationTests.java | 6 +++--- .../shook/shook/auth/application/AuthServiceTest.java | 1 - .../shook/auth/application/TokenPairSchedulerTest.java | 3 ++- .../shook/shook/auth/ui/interceptor/PathMethodTest.java | 1 - .../java/shook/shook/song/domain/InMemorySongsTest.java | 1 - 18 files changed, 23 insertions(+), 27 deletions(-) diff --git a/backend/src/main/java/shook/shook/auth/application/AuthService.java b/backend/src/main/java/shook/shook/auth/application/AuthService.java index 9031541be..e86c3f421 100644 --- a/backend/src/main/java/shook/shook/auth/application/AuthService.java +++ b/backend/src/main/java/shook/shook/auth/application/AuthService.java @@ -35,7 +35,8 @@ public TokenPair oAuthLogin(final String oauthType, final String authorizationCo return new TokenPair(accessToken, refreshToken); } - public ReissueAccessTokenResponse reissueAccessTokenByRefreshToken(final String refreshToken, final String accessToken) { + public ReissueAccessTokenResponse reissueAccessTokenByRefreshToken(final String refreshToken, + final String accessToken) { final Claims claims = tokenProvider.parseClaims(refreshToken); final Long memberId = claims.get("memberId", Long.class); final String nickname = claims.get("nickname", String.class); diff --git a/backend/src/main/java/shook/shook/auth/application/KakaoInfoProvider.java b/backend/src/main/java/shook/shook/auth/application/KakaoInfoProvider.java index 73f83cb9c..0db0672c7 100644 --- a/backend/src/main/java/shook/shook/auth/application/KakaoInfoProvider.java +++ b/backend/src/main/java/shook/shook/auth/application/KakaoInfoProvider.java @@ -25,7 +25,6 @@ public class KakaoInfoProvider implements OAuthInfoProvider { private static final String TOKEN_PREFIX = "Bearer "; private static final String GRANT_TYPE = "authorization_code"; - @Value("${oauth2.kakao.access-token-url}") private String KAKAO_ACCESS_TOKEN_URL; diff --git a/backend/src/main/java/shook/shook/auth/application/dto/KakaoMemberInfoResponse.java b/backend/src/main/java/shook/shook/auth/application/dto/KakaoMemberInfoResponse.java index 2103c518a..a8953b04f 100644 --- a/backend/src/main/java/shook/shook/auth/application/dto/KakaoMemberInfoResponse.java +++ b/backend/src/main/java/shook/shook/auth/application/dto/KakaoMemberInfoResponse.java @@ -1,6 +1,5 @@ package shook.shook.auth.application.dto; -import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/backend/src/main/java/shook/shook/auth/config/AuthConfig.java b/backend/src/main/java/shook/shook/auth/config/AuthConfig.java index 75323fd8f..0a8730471 100644 --- a/backend/src/main/java/shook/shook/auth/config/AuthConfig.java +++ b/backend/src/main/java/shook/shook/auth/config/AuthConfig.java @@ -20,8 +20,8 @@ public class AuthConfig implements WebMvcConfigurer { private final TokenInterceptor tokenInterceptor; public AuthConfig(final AuthArgumentResolver authArgumentResolver, - final LoginCheckerInterceptor loginCheckerInterceptor, - final TokenInterceptor tokenInterceptor + final LoginCheckerInterceptor loginCheckerInterceptor, + final TokenInterceptor tokenInterceptor ) { this.authArgumentResolver = authArgumentResolver; this.loginCheckerInterceptor = loginCheckerInterceptor; diff --git a/backend/src/main/java/shook/shook/auth/ui/interceptor/LoginCheckerInterceptor.java b/backend/src/main/java/shook/shook/auth/ui/interceptor/LoginCheckerInterceptor.java index 96b212772..d64515a1c 100644 --- a/backend/src/main/java/shook/shook/auth/ui/interceptor/LoginCheckerInterceptor.java +++ b/backend/src/main/java/shook/shook/auth/ui/interceptor/LoginCheckerInterceptor.java @@ -17,8 +17,9 @@ public LoginCheckerInterceptor( } @Override - public boolean preHandle(final HttpServletRequest request, final HttpServletResponse response, - final Object handler) throws Exception { + public boolean preHandle(final HttpServletRequest request, + final HttpServletResponse response, + final Object handler) throws Exception { if (TokenHeaderExtractor.extractToken(request).isEmpty()) { return true; } diff --git a/backend/src/main/java/shook/shook/auth/ui/interceptor/PathMatcherInterceptor.java b/backend/src/main/java/shook/shook/auth/ui/interceptor/PathMatcherInterceptor.java index 17fee5947..04e578a82 100644 --- a/backend/src/main/java/shook/shook/auth/ui/interceptor/PathMatcherInterceptor.java +++ b/backend/src/main/java/shook/shook/auth/ui/interceptor/PathMatcherInterceptor.java @@ -15,8 +15,9 @@ public PathMatcherInterceptor(final HandlerInterceptor handlerInterceptor) { } @Override - public boolean preHandle(final HttpServletRequest request, final HttpServletResponse response, - final Object handler) throws Exception { + public boolean preHandle(final HttpServletRequest request, + final HttpServletResponse response, + final Object handler) throws Exception { if (pathContainer.isNotIncludedPath(request.getServletPath(), request.getMethod())) { return true; } @@ -24,13 +25,13 @@ public boolean preHandle(final HttpServletRequest request, final HttpServletResp } public PathMatcherInterceptor includePathPattern(final String requestPathPattern, - final PathMethod requestPathMethod) { + final PathMethod requestPathMethod) { pathContainer.includePathPattern(requestPathPattern, requestPathMethod); return this; } public PathMatcherInterceptor excludePathPattern(final String requestPathPattern, - final PathMethod requestPathMethod) { + final PathMethod requestPathMethod) { pathContainer.excludePathPattern(requestPathPattern, requestPathMethod); return this; } diff --git a/backend/src/main/java/shook/shook/auth/ui/interceptor/RequestPathPattern.java b/backend/src/main/java/shook/shook/auth/ui/interceptor/RequestPathPattern.java index e93daf001..761cc3a13 100644 --- a/backend/src/main/java/shook/shook/auth/ui/interceptor/RequestPathPattern.java +++ b/backend/src/main/java/shook/shook/auth/ui/interceptor/RequestPathPattern.java @@ -12,8 +12,9 @@ public RequestPathPattern(final String path, final PathMethod method) { this.method = method; } - public boolean match(final PathMatcher pathMatcher, final String requestPath, - final String requestMethod) { + public boolean match(final PathMatcher pathMatcher, + final String requestPath, + final String requestMethod) { return pathMatcher.match(path, requestPath) && method.match(requestMethod); } } diff --git a/backend/src/main/java/shook/shook/member/application/MemberService.java b/backend/src/main/java/shook/shook/member/application/MemberService.java index 13a94be5a..1c95d7033 100644 --- a/backend/src/main/java/shook/shook/member/application/MemberService.java +++ b/backend/src/main/java/shook/shook/member/application/MemberService.java @@ -78,7 +78,7 @@ private Member findById(final Long id) { } private void validateMemberAuthentication(final Member requestMember, - final Member targetMember) { + final Member targetMember) { if (!requestMember.equals(targetMember)) { throw new AuthorizationException.UnauthenticatedException( Map.of( diff --git a/backend/src/main/java/shook/shook/member/domain/Email.java b/backend/src/main/java/shook/shook/member/domain/Email.java index 85f54a199..cd3c3bbad 100644 --- a/backend/src/main/java/shook/shook/member/domain/Email.java +++ b/backend/src/main/java/shook/shook/member/domain/Email.java @@ -3,8 +3,6 @@ import jakarta.persistence.Column; import jakarta.persistence.Embeddable; import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import lombok.AccessLevel; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/backend/src/main/java/shook/shook/song/application/dto/SongResponse.java b/backend/src/main/java/shook/shook/song/application/dto/SongResponse.java index 057e22d3d..761369bf2 100644 --- a/backend/src/main/java/shook/shook/song/application/dto/SongResponse.java +++ b/backend/src/main/java/shook/shook/song/application/dto/SongResponse.java @@ -58,7 +58,7 @@ public static SongResponse fromUnauthorizedUser(final Song song) { } private static List toKillingPartResponses(final Song song, - final Member member) { + final Member member) { final List songKillingParts = song.getLikeCountSortedKillingParts(); return IntStream.range(0, songKillingParts.size()) diff --git a/backend/src/main/java/shook/shook/song/domain/killingpart/repository/KillingPartLikeRepository.java b/backend/src/main/java/shook/shook/song/domain/killingpart/repository/KillingPartLikeRepository.java index bb210fe3c..d3ea0c70e 100644 --- a/backend/src/main/java/shook/shook/song/domain/killingpart/repository/KillingPartLikeRepository.java +++ b/backend/src/main/java/shook/shook/song/domain/killingpart/repository/KillingPartLikeRepository.java @@ -12,7 +12,7 @@ public interface KillingPartLikeRepository extends JpaRepository { Optional findByKillingPartAndMember(final KillingPart killingPart, - final Member member); + final Member member); List findAllByMemberAndIsDeleted(final Member member, final boolean isDeleted); } diff --git a/backend/src/main/java/shook/shook/voting_song/domain/VotingSongPart.java b/backend/src/main/java/shook/shook/voting_song/domain/VotingSongPart.java index 5ca823f40..3efdc5460 100644 --- a/backend/src/main/java/shook/shook/voting_song/domain/VotingSongPart.java +++ b/backend/src/main/java/shook/shook/voting_song/domain/VotingSongPart.java @@ -162,7 +162,6 @@ public int getVoteCount() { return votes.size(); } - @Override public boolean equals(final Object o) { if (this == o) { diff --git a/backend/src/main/java/shook/shook/voting_song/ui/VotingSongPartController.java b/backend/src/main/java/shook/shook/voting_song/ui/VotingSongPartController.java index 30e4acba8..24c28a3ab 100644 --- a/backend/src/main/java/shook/shook/voting_song/ui/VotingSongPartController.java +++ b/backend/src/main/java/shook/shook/voting_song/ui/VotingSongPartController.java @@ -1,6 +1,5 @@ package shook.shook.voting_song.ui; - import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; diff --git a/backend/src/test/java/shook/shook/ShookApplicationTests.java b/backend/src/test/java/shook/shook/ShookApplicationTests.java index 4b3ba0fa0..c4ffa3a54 100644 --- a/backend/src/test/java/shook/shook/ShookApplicationTests.java +++ b/backend/src/test/java/shook/shook/ShookApplicationTests.java @@ -6,8 +6,8 @@ @SpringBootTest class ShookApplicationTests { - @Test - void contextLoads() { - } + @Test + void contextLoads() { + } } diff --git a/backend/src/test/java/shook/shook/auth/application/AuthServiceTest.java b/backend/src/test/java/shook/shook/auth/application/AuthServiceTest.java index c77218d9a..3e2bd511d 100644 --- a/backend/src/test/java/shook/shook/auth/application/AuthServiceTest.java +++ b/backend/src/test/java/shook/shook/auth/application/AuthServiceTest.java @@ -2,7 +2,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; diff --git a/backend/src/test/java/shook/shook/auth/application/TokenPairSchedulerTest.java b/backend/src/test/java/shook/shook/auth/application/TokenPairSchedulerTest.java index 05aa20c2c..da6e79a9a 100644 --- a/backend/src/test/java/shook/shook/auth/application/TokenPairSchedulerTest.java +++ b/backend/src/test/java/shook/shook/auth/application/TokenPairSchedulerTest.java @@ -48,7 +48,8 @@ void renewInMemoryTokenPairRepository() { inMemoryTokenPairRepository.addOrUpdateTokenPair(expiredRefreshToken, expiredAccessToken); // when - final TokenPairScheduler tokenPairScheduler = new TokenPairScheduler(tokenProvider, inMemoryTokenPairRepository); + final TokenPairScheduler tokenPairScheduler + = new TokenPairScheduler(tokenProvider, inMemoryTokenPairRepository); tokenPairScheduler.removeExpiredTokenPair(); // then diff --git a/backend/src/test/java/shook/shook/auth/ui/interceptor/PathMethodTest.java b/backend/src/test/java/shook/shook/auth/ui/interceptor/PathMethodTest.java index b60c216c2..cecc685fc 100644 --- a/backend/src/test/java/shook/shook/auth/ui/interceptor/PathMethodTest.java +++ b/backend/src/test/java/shook/shook/auth/ui/interceptor/PathMethodTest.java @@ -6,7 +6,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; - class PathMethodTest { @DisplayName("요청 메소드 이름이 인자로 들어오는 경우 요소의 이름과 비교하여 대소문자 구분없이 같은 true를 반환한다.") diff --git a/backend/src/test/java/shook/shook/song/domain/InMemorySongsTest.java b/backend/src/test/java/shook/shook/song/domain/InMemorySongsTest.java index 71ed04cc3..872023c82 100644 --- a/backend/src/test/java/shook/shook/song/domain/InMemorySongsTest.java +++ b/backend/src/test/java/shook/shook/song/domain/InMemorySongsTest.java @@ -35,7 +35,6 @@ void setUp() { inMemorySongs = new InMemorySongs(); } - @DisplayName("InMemorySong 을 1.좋아요 순, 2. id 순으로 정렬된 노래로 초기화한다.") @Test void recreate() {