Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] refactor: 프로덕션 로그인 쿠키 이름과 테스트 로그인 쿠키 이름 통일 #819

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class LoginSteps {

public static ExtractableResponse<Response> 로그아웃_요청(final String loginCookie) {
return given()
.cookie("JSESSIONID", loginCookie)
.cookie("SESSION", loginCookie)
.when()
.post("/api/logout")
.then()
Expand All @@ -44,6 +44,6 @@ public class LoginSteps {
.then()
.extract()
.response()
.getCookie("JSESSIONID");
.getCookie("SESSION");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class MemberSteps {

public static ExtractableResponse<Response> 사용자_정보_조회_요청(final String loginCookie) {
return given()
.cookie("JSESSIONID", loginCookie)
.cookie("SESSION", loginCookie)
.when()
.get("/api/members")
.then()
Expand All @@ -24,7 +24,7 @@ public class MemberSteps {
final MultiPartSpecification image,
final MemberRequest request) {
final var requestSpec = given()
.cookie("JSESSIONID", loginCookie);
.cookie("SESSION", loginCookie);

if (Objects.nonNull(image)) {
requestSpec.multiPart(image);
Expand All @@ -43,7 +43,7 @@ public class MemberSteps {
final Long page) {
return given()
.when()
.cookie("JSESSIONID", loginCookie)
.cookie("SESSION", loginCookie)
.queryParam("sort", sort)
.queryParam("page", page)
.get("/api/members/reviews")
Expand All @@ -55,7 +55,7 @@ public class MemberSteps {
final Long page) {
return given()
.when()
.cookie("JSESSIONID", loginCookie)
.cookie("SESSION", loginCookie)
.queryParam("sort", sort)
.queryParam("page", page)
.get("/api/members/recipes")
Expand All @@ -65,7 +65,7 @@ public class MemberSteps {

public static ExtractableResponse<Response> 리뷰_삭제_요청(final String loginCookie, final Long reviewId) {
return given()
.cookie("JSESSIONID", loginCookie)
.cookie("SESSION", loginCookie)
.when()
.delete("/api/members/reviews/{reviewId}", reviewId)
.then()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class RecipeSteps {
final List<MultiPartSpecification> images,
final RecipeCreateRequest recipeRequest) {
final var requestSpec = given()
.cookie("JSESSIONID", loginCookie);
.cookie("SESSION", loginCookie);

if (Objects.nonNull(images) && !images.isEmpty()) {
images.forEach(requestSpec::multiPart);
Expand All @@ -37,7 +37,7 @@ public class RecipeSteps {

public static ExtractableResponse<Response> 레시피_상세_정보_요청(final String loginCookie, final Long recipeId) {
return given()
.cookie("JSESSIONID", loginCookie)
.cookie("SESSION", loginCookie)
.when()
.get("/api/recipes/{recipeId}", recipeId)
.then()
Expand All @@ -57,7 +57,7 @@ public class RecipeSteps {
public static ExtractableResponse<Response> 레시피_좋아요_요청(final String loginCookie, final Long recipeId,
final RecipeFavoriteRequest request) {
return given()
.cookie("JSESSIONID", loginCookie)
.cookie("SESSION", loginCookie)
.contentType("application/json")
.body(request)
.when()
Expand Down Expand Up @@ -97,7 +97,7 @@ public class RecipeSteps {
final Long recipeId,
final RecipeCommentCreateRequest request) {
return given()
.cookie("JSESSIONID", loginCookie)
.cookie("SESSION", loginCookie)
.contentType("application/json")
.body(request)
.when()
Expand All @@ -109,7 +109,7 @@ public class RecipeSteps {
public static ExtractableResponse<Response> 레시피_댓글_조회_요청(final String loginCookie, final Long recipeId,
final RecipeCommentCondition condition) {
return given()
.cookie("JSESSIONID", loginCookie)
.cookie("SESSION", loginCookie)
.contentType("application/json")
.param("lastId", condition.getLastId())
.param("totalElements", condition.getTotalElements())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ReviewSteps {
final MultiPartSpecification image,
final ReviewCreateRequest request) {
final var requestSpec = given()
.cookie("JSESSIONID", loginCookie);
.cookie("SESSION", loginCookie);

if (Objects.nonNull(image)) {
requestSpec.multiPart(image);
Expand All @@ -36,7 +36,7 @@ public class ReviewSteps {
public static ExtractableResponse<Response> 리뷰_좋아요_요청(final String loginCookie, final Long productId,
final Long reviewId, final ReviewFavoriteRequest request) {
return given()
.cookie("JSESSIONID", loginCookie)
.cookie("SESSION", loginCookie)
.contentType("application/json")
.body(request)
.when()
Expand All @@ -58,7 +58,7 @@ public class ReviewSteps {
final Long lastReviewId,
final String sort, final Long page) {
return given()
.cookie("JSESSIONID", loginCookie)
.cookie("SESSION", loginCookie)
.queryParam("sort", sort)
.queryParam("page", page)
.queryParam("lastReviewId", lastReviewId).log().all()
Expand Down
6 changes: 6 additions & 0 deletions backend/src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ cloud:
back-office:
id: test
key: test

server:
servlet:
session:
cookie:
name: SESSION