This repository has been archived by the owner on Aug 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
주요 내용 1. 메서드 보안방식 (@PreAuthorize) 반영 및 글로벌 filter 보안 제거 2. rest assured http call 방식을 이용한 테스트 및 헬퍼 클래스 작성 Closes #66
- Loading branch information
kms
committed
Aug 13, 2021
1 parent
50083f7
commit cc1f699
Showing
4 changed files
with
29 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
app-main/src/test/kotlin/kr/flab/wiki/app/testlib/LoginTestHelper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package kr.flab.wiki.app.testlib | ||
|
||
import io.restassured.RestAssured | ||
import io.restassured.specification.RequestSpecification | ||
import kr.flab.wiki.app.api.user.request.LoginRequest | ||
import kr.flab.wiki.app.api.user.response.LoginResponse | ||
|
||
object LoginTestHelper { | ||
|
||
fun makeLoginResponse(requestSpecification: RequestSpecification, email: String, password: String): LoginResponse { | ||
return RestAssured | ||
.given() | ||
.spec(requestSpecification) | ||
.body(LoginRequest(email, password)) | ||
.`when`() | ||
.post("/login") | ||
.then() | ||
.extract() | ||
.`as`(LoginResponse::class.java) | ||
} | ||
|
||
} |