test(user-service): 점주 회원가입 테스트 작성
- spring security 관련 테스트 설정 추가
This commit is contained in:
@@ -35,7 +35,7 @@ dependencies {
|
|||||||
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
|
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
|
||||||
/*implementation 'org.springframework.boot:spring-boot-starter-amqp'*/
|
/*implementation 'org.springframework.boot:spring-boot-starter-amqp'*/
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||||
compileOnly 'org.springframework.boot:spring-boot-starter-oauth2-client'
|
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
|
||||||
implementation 'org.springframework.cloud:spring-cloud-starter-config'
|
implementation 'org.springframework.cloud:spring-cloud-starter-config'
|
||||||
/*implementation 'org.springframework.kafka:spring-kafka'*/
|
/*implementation 'org.springframework.kafka:spring-kafka'*/
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
|
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
|
||||||
@@ -55,6 +55,8 @@ dependencies {
|
|||||||
testImplementation 'org.springframework.security:spring-security-test'
|
testImplementation 'org.springframework.security:spring-security-test'
|
||||||
testImplementation 'com.h2database:h2'
|
testImplementation 'com.h2database:h2'
|
||||||
|
|
||||||
|
testImplementation 'org.springframework.security:spring-security-test'
|
||||||
|
|
||||||
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
|
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
|
||||||
// operation block 을 위한 의존성
|
// operation block 을 위한 의존성
|
||||||
asciidoctorExtensions 'org.springframework.restdocs:spring-restdocs-asciidoctor'
|
asciidoctorExtensions 'org.springframework.restdocs:spring-restdocs-asciidoctor'
|
||||||
|
|||||||
@@ -68,4 +68,8 @@ domain-httpRequestCode-etc
|
|||||||
=== 회원 조회
|
=== 회원 조회
|
||||||
operation::customer-get[snippets='curl-request,http-request,http-response,path-parameters,response-fields']
|
operation::customer-get[snippets='curl-request,http-request,http-response,path-parameters,response-fields']
|
||||||
=== 회원 조회 (존재하지 않는 회원)
|
=== 회원 조회 (존재하지 않는 회원)
|
||||||
operation::customer-get-notExistUserException[snippets='curl-request,http-request,http-response,path-parameters,response-fields']
|
operation::customer-get-notExistUserException[snippets='curl-request,http-request,http-response,path-parameters,response-fields']
|
||||||
|
|
||||||
|
== 점주
|
||||||
|
=== 회원가입 - 점주
|
||||||
|
operation::storeOwner-post[snippets='curl-request,http-request,http-response,request-fields,response-fields']
|
||||||
@@ -48,7 +48,7 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/store/join")
|
@PostMapping("/store-owner")
|
||||||
public ResponseEntity<Result> joinStoreOwner(@Valid @RequestBody JoinStoreOwnerRequest joinRequest) {
|
public ResponseEntity<Result> joinStoreOwner(@Valid @RequestBody JoinStoreOwnerRequest joinRequest) {
|
||||||
// 회원 가입
|
// 회원 가입
|
||||||
userService.saveStoreOwner(joinRequest.toStoreOwnerDto());
|
userService.saveStoreOwner(joinRequest.toStoreOwnerDto());
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
.userService(oAuthService);
|
.userService(oAuthService);
|
||||||
|
|
||||||
http.addFilter(loginAuthenticationFilter);
|
http.addFilter(loginAuthenticationFilter);
|
||||||
http.addFilterBefore(new HeaderAuthorizationFilter(), UsernamePasswordAuthenticationFilter.class);
|
// http.addFilterBefore(new HeaderAuthorizationFilter(), UsernamePasswordAuthenticationFilter.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user