Skip to content

Commit

Permalink
chore: (#129) 코드 컨벤션 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
woo-chang committed Aug 1, 2023
1 parent 8bcbf93 commit d90c171
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public ResponseEntity<Void> createComment(
})
@GetMapping("/{postId}/comments")
public ResponseEntity<List<CommentResponse>> getComments(@PathVariable final Long postId) {
List<CommentResponse> response = postCommentService.getComments(postId);
final List<CommentResponse> response = postCommentService.getComments(postId);
return ResponseEntity.ok(response);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.votogether.domain.post.dto.response.CommentResponse;
import com.votogether.domain.post.entity.comment.Comment;
import com.votogether.domain.post.service.PostCommentService;
import com.votogether.exception.GlobalExceptionHandler;
import com.votogether.fixtures.MemberFixtures;
import com.votogether.global.jwt.TokenPayload;
import com.votogether.global.jwt.TokenProcessor;
Expand All @@ -36,7 +37,7 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;

@WebMvcTest(PostCommentController.class)
class PostCommentControllerTest {
Expand All @@ -51,9 +52,12 @@ class PostCommentControllerTest {
TokenProcessor tokenProcessor;

@BeforeEach
void setUp(WebApplicationContext webApplicationContext) {
RestAssuredMockMvc.standaloneSetup(new PostCommentController(postCommentService));
RestAssuredMockMvc.webAppContextSetup(webApplicationContext);
void setUp() {
RestAssuredMockMvc.standaloneSetup(
MockMvcBuilders
.standaloneSetup(new PostCommentController(postCommentService))
.setControllerAdvice(GlobalExceptionHandler.class)
);
}

@Nested
Expand Down Expand Up @@ -185,7 +189,7 @@ void getComments() throws Exception {

// when
List<CommentResponse> response = RestAssuredMockMvc.given().log().all()
.headers(HttpHeaders.AUTHORIZATION, "Bearer token")
//.headers(HttpHeaders.AUTHORIZATION, "Bearer token")
.when().get("/posts/{postId}/comments", 1L)
.then().log().all()
.status(HttpStatus.OK)
Expand Down

0 comments on commit d90c171

Please sign in to comment.