diff --git a/src/main/java/com/liberty52/product/global/exception/external/forbidden/InvalidRoleException.java b/src/main/java/com/liberty52/product/global/exception/external/forbidden/InvalidRoleException.java index 038d875a..98a0c323 100644 --- a/src/main/java/com/liberty52/product/global/exception/external/forbidden/InvalidRoleException.java +++ b/src/main/java/com/liberty52/product/global/exception/external/forbidden/InvalidRoleException.java @@ -1,16 +1,8 @@ package com.liberty52.product.global.exception.external.forbidden; -<<<<<<< HEAD -======= -import com.liberty52.product.global.exception.external.forbidden.NotYourResourceException; ->>>>>>> dev public class InvalidRoleException extends NotYourResourceException { public InvalidRoleException(String role) { super("Role", role); } -<<<<<<< HEAD } -======= -} ->>>>>>> dev diff --git a/src/main/java/com/liberty52/product/service/controller/ReplyCreateController.java b/src/main/java/com/liberty52/product/service/controller/ReplyCreateController.java index 3353896d..0093ec3b 100644 --- a/src/main/java/com/liberty52/product/service/controller/ReplyCreateController.java +++ b/src/main/java/com/liberty52/product/service/controller/ReplyCreateController.java @@ -23,7 +23,7 @@ public class ReplyCreateController { @PostMapping("/reviews/{reviewId}/replies") @ResponseStatus(HttpStatus.CREATED) public void createReply(@RequestHeader(HttpHeaders.AUTHORIZATION) String adminId, - @RequestHeader("X-ROLE") String role, + @RequestHeader("LB-Role") String role, @Validated @RequestBody ReplyCreateRequestDto dto, @PathVariable String reviewId) { replyCreateService.createReply(adminId,dto,reviewId, role); } diff --git a/src/test/java/com/liberty52/product/service/controller/ReplyCreateControllerTest.java b/src/test/java/com/liberty52/product/service/controller/ReplyCreateControllerTest.java index 635622fb..9ca7a4d4 100644 --- a/src/test/java/com/liberty52/product/service/controller/ReplyCreateControllerTest.java +++ b/src/test/java/com/liberty52/product/service/controller/ReplyCreateControllerTest.java @@ -55,6 +55,7 @@ class ReplyCreateControllerTest { final String mockAdminRole = ADMIN; final String mockUserRole = "USER"; final String mockReplyContent = "Hello world"; + final String headerRole = "LB-Role"; @Test void Craete_Reply_Success_Status_CRAETED () throws Exception{ //given @@ -62,7 +63,7 @@ void Craete_Reply_Success_Status_CRAETED () throws Exception{ //when mockMvc.perform(post(String.format(createReplyUrl,mockReviewId)) .header(HttpHeaders.AUTHORIZATION,mockAdminId) - .header("X-ROLE",mockAdminRole) + .header(headerRole,mockAdminRole) .contentType(MediaType.APPLICATION_JSON) .content(new ObjectMapper().writeValueAsString(dto))) //then @@ -88,7 +89,7 @@ void CREATE_REPLY_FAIL_STATUS_FORBIDDEN_InvalidRoleException () throws Exception //when mockMvc.perform(post(String.format(createReplyUrl,mockReviewId)) .header(HttpHeaders.AUTHORIZATION,mockAdminId) - .header("X-ROLE",mockUserRole) + .header(headerRole,mockUserRole) .contentType(MediaType.APPLICATION_JSON) .content(new ObjectMapper().writeValueAsString(dto))) //then @@ -120,7 +121,7 @@ void CREATE_REPLY_FAIL_STATUS_NOT_FOUND_ResourceNotFoundException () throws Exce //when mockMvc.perform(post(String.format(createReplyUrl,mockReviewId)) .header(HttpHeaders.AUTHORIZATION,mockAdminId) - .header("X-ROLE",mockAdminRole) + .header(headerRole,mockAdminRole) .contentType(MediaType.APPLICATION_JSON) .content(new ObjectMapper().writeValueAsString(dto))) //then