Skip to content

Commit

Permalink
refactor: Optimize Imports & Reformat Code
Browse files Browse the repository at this point in the history
  • Loading branch information
axhtl committed Sep 5, 2024
1 parent b2349a3 commit e11e842
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ class SecurityConfiguration(
"/v1/seller/orders/**", "/v1/seller/orders", "/v1/orders/**", "/v1/orderdetails/**",
"/swagger-resources/**", "/swagger-ui/**", "/v3/api-docs/**", "/v1/members/auth/**",
"/auth/**", "/kakaoLogin/**", "/kakao_login_medium_narrow.png", "/v1/members?signUpType=KAKAO",
"/auth/**","/kakaoLogin/**", "/kakao_login_medium_narrow.png",
"/auth/**", "/kakaoLogin/**", "/kakao_login_medium_narrow.png",
"/swagger-resources/**", "/swagger-ui/**", "/v3/api-docs/**", "/v1/members/auth/**",
"config-service/**",
"/auth/**","/kakaoLogin/**", "/kakao_login_medium_narrow.png", "/v1/members?signUpType=KAKAO",
"/auth/**", "/kakaoLogin/**", "/kakao_login_medium_narrow.png", "/v1/members?signUpType=KAKAO",
"/auth/**", "/kakaoLogin/**", "/kakao_login_medium_narrow.png", "/v1/members?signUpType=KAKAO",
"/v1/members?signUpType=KAKAO",
"/v1/members/**",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package org.store.clothstar.common.error.exception

import org.store.clothstar.common.error.ErrorCode

class InvalidSignupMemberRequest (
class InvalidSignupMemberRequest(
val errorCode: ErrorCode
) : RuntimeException(errorCode.message)
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package org.store.clothstar.common.error.exception

import org.store.clothstar.common.error.ErrorCode

class InvalidSignupType (
class InvalidSignupType(
val errorCode: ErrorCode
) : RuntimeException(errorCode.message)
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class AuthenticationController(
?: throw InvalidSignupMemberRequest(ErrorCode.INVALID_SIGNUP_MEMBER_REQUEST)
signUpService.signUp(kakaoMemberRequest)
}

else -> throw InvalidSignupType(ErrorCode.INVLIAD_SIGNUP_TYPE)
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spring:
port: 6379
duration: 600

#oauth2
#oauth2
security:
oauth2:
client:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
package org.store.clothstar.member.authentication.controller

import com.fasterxml.jackson.databind.ObjectMapper
import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.MockWebServer
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.http.MediaType
import org.springframework.test.context.ActiveProfiles
import org.springframework.test.web.servlet.MockMvc
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.status
import org.springframework.transaction.annotation.Transactional
import org.store.clothstar.common.config.redis.RedisUtil
import org.store.clothstar.member.util.CreateObject
import com.fasterxml.jackson.databind.ObjectMapper
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.http.MediaType
import org.store.clothstar.kakaoLogin.service.KakaoLoginService
import org.store.clothstar.member.authentication.domain.SignUpType
import org.store.clothstar.member.dto.request.KakaoMemberRequest
import org.store.clothstar.member.dto.request.SignUpRequest
import org.store.clothstar.member.authentication.domain.SignUpType
import org.store.clothstar.member.util.CreateObject

@SpringBootTest
@AutoConfigureMockMvc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ class MemberSignupValidTest(

//then
actions.andExpect(status().is4xxClientError())
actions.andExpect(MockMvcResultMatchers.jsonPath("$.errorMap['createMemberRequest.password']").value("비밀번호는 최소 8자 이상이어야 합니다."))
actions.andExpect(
MockMvcResultMatchers.jsonPath("$.errorMap['createMemberRequest.password']").value("비밀번호는 최소 8자 이상이어야 합니다.")
)
}

@DisplayName("회원가입시 이름은 필수 값이다.")
Expand Down Expand Up @@ -85,7 +87,9 @@ class MemberSignupValidTest(
//then
Assertions.assertThat(createMemberRequest.password.length).isLessThan(8)
actions.andExpect(status().is4xxClientError())
actions.andExpect(MockMvcResultMatchers.jsonPath("$.errorMap.['createMemberRequest.name']").value("이름은 비어 있을 수 없습니다."))
actions.andExpect(
MockMvcResultMatchers.jsonPath("$.errorMap.['createMemberRequest.name']").value("이름은 비어 있을 수 없습니다.")
)
}

@DisplayName("회원가입시 전화번호 양식이 지켜져야 한다.")
Expand Down Expand Up @@ -113,7 +117,9 @@ class MemberSignupValidTest(
//then
Assertions.assertThat(createMemberRequest.password.length).isLessThan(8)
actions.andExpect(status().is4xxClientError())
actions.andExpect(MockMvcResultMatchers.jsonPath("$.errorMap.['createMemberRequest.telNo']").value("유효하지 않은 전화번호 형식입니다."))
actions.andExpect(
MockMvcResultMatchers.jsonPath("$.errorMap.['createMemberRequest.telNo']").value("유효하지 않은 전화번호 형식입니다.")
)
}

@DisplayName("비밀번호 변경 요청시에도 비밀번호는 8자리 이상이여야 한다.")
Expand Down

0 comments on commit e11e842

Please sign in to comment.