Skip to content

Commit

Permalink
refactor: 필요없는 import 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
zangsu committed Jan 18, 2025
1 parent e10d30f commit d64495e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import codezap.auth.manager.CredentialManager;
import codezap.auth.manager.CredentialManagers;
import codezap.auth.provider.CredentialProvider;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class CredentialManagers {
private final List<CredentialManager> credentialManagers;

public Credential getCredential(HttpServletRequest request) {
if(!hasCredential(request)) {
if (!hasCredential(request)) {
throw new CodeZapException(ErrorCode.UNAUTHORIZED_USER, "인증 정보가 없습니다. 다시 로그인해 주세요.");
}
return getCredentialManager(request).getCredential(request);
Expand All @@ -31,7 +31,9 @@ public boolean hasCredential(HttpServletRequest request) {
return getCredentialManager(request).hasCredential(request);
}

public void setCredential(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Credential credential) {
public void setCredential(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse,
Credential credential
) {
getCredentialManager(httpServletRequest).setCredential(httpServletResponse, credential);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import codezap.auth.dto.LoginMember;
import codezap.auth.dto.Credential;
import codezap.auth.manager.AuthorizationHeaderCredentialManager;
import java.lang.reflect.Method;

import java.util.List;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
Expand All @@ -20,8 +17,10 @@
import org.springframework.web.context.request.async.StandardServletAsyncWebRequest;
import org.springframework.web.method.support.ModelAndViewContainer;

import codezap.auth.dto.Credential;
import codezap.auth.dto.LoginMember;
import codezap.auth.manager.AuthorizationHeaderCredentialManager;
import codezap.auth.manager.CookieCredentialManager;
import codezap.auth.manager.CredentialManager;
import codezap.auth.manager.CredentialManagers;
import codezap.auth.provider.CredentialProvider;
import codezap.auth.provider.PlainCredentialProvider;
Expand All @@ -35,7 +34,8 @@ class AuthArgumentResolverTest {
List.of(new CookieCredentialManager(), new AuthorizationHeaderCredentialManager())
);

private final AuthArgumentResolver authArgumentResolver = new AuthArgumentResolver(credentialManagers, credentialProvider);
private final AuthArgumentResolver authArgumentResolver = new AuthArgumentResolver(credentialManagers,
credentialProvider);

@Nested
@DisplayName("지원하는 파라미터 테스트")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package codezap.category.controller;

import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.when;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
Expand All @@ -19,8 +17,6 @@
import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType;

import com.fasterxml.jackson.core.JsonProcessingException;

import codezap.category.domain.Category;
import codezap.category.dto.request.CreateCategoryRequest;
import codezap.category.dto.request.UpdateAllCategoriesRequest;
Expand All @@ -29,8 +25,6 @@
import codezap.category.dto.response.FindAllCategoriesResponse;
import codezap.fixture.MemberFixture;
import codezap.global.MockMvcTest;
import codezap.global.exception.CodeZapException;
import codezap.global.exception.ErrorCode;
import codezap.member.domain.Member;

@Import(CategoryController.class)
Expand Down

0 comments on commit d64495e

Please sign in to comment.