[강현홍] sprint7#157
Open
Newbress wants to merge 17 commits into
Open
Conversation
Collaborator
|
Merge 하려는 타겟 브랜치 변경 부탁드려요. |
Collaborator
|
.gitignore 파일에 .log* 추가해서 원격저장소에 올라가지 않도록 권장드려요. |
eedys1234
approved these changes
Apr 8, 2026
| max-file-size: ${spring.servlet.multipart.max-file-size} | ||
| max-request-size: ${spring.servlet.multipart.max-request-size} | ||
|
|
||
| management: |
| </encoder> | ||
| </appender> | ||
|
|
||
| <root level="info"> |
Collaborator
There was a problem hiding this comment.
환경별로 로그를 기록하는 걸 분리해보는걸 권장드려요.
| import jakarta.validation.constraints.NotNull; | ||
|
|
||
| public record BinaryContentCreateRequest( | ||
| @NotNull |
Collaborator
| import com.sprint.mission.discodeit.exception.ErrorCode; | ||
| import java.util.Map; | ||
|
|
||
| public abstract class UserStatusException extends DiscodeitException { |
Collaborator
There was a problem hiding this comment.
중간계층의 Exception을 가진 부분 좋습니다.
중간계층 Exception이 존재할 경우 중간계층 Exception들을 세밀하게 에러처리 가능한 장점이 있습니다.
| @RequiredArgsConstructor | ||
| @RestController | ||
| @RequestMapping("/api/binaryContents") | ||
| public class BinaryContentController { |
Collaborator
There was a problem hiding this comment.
AOP를 활용하여 Controller 모든 메서드의 Request, Response 로깅을 한번 해보시는걸 추천드려요.
| "userCreateRequest", "", MediaType.APPLICATION_JSON_VALUE, invalidJson.getBytes() | ||
| ); | ||
|
|
||
| MockMultipartFile profile = new MockMultipartFile( |
| @Test | ||
| @DisplayName("퍼블릭 채널 생성 통합 테스트 - 성공 (실제 DB 저장 확인)") | ||
| void createPublicChannel_Integration_Success() throws Exception { | ||
| String requestJson = "{\"name\":\"통합테스트채널\", \"description\":\"통합 테스트용 퍼블릭 채널\"}"; |
Collaborator
There was a problem hiding this comment.
JSON 형태의 String 을 전달하기 보다는 실제 활용되는 Request 객체를 생성하여 ObjectMapper를 통해 JSON으로 직렬화하는 방법을 권장드려요.
| @Test | ||
| @DisplayName("채널 정보 수정 통합 테스트 - 성공 (실제 DB 변경 확인)") | ||
| void updateChannel_Integration_Success() throws Exception { | ||
| Channel channel = new Channel(ChannelType.PUBLIC, "수정전이름", "수정전설명"); |
Collaborator
There was a problem hiding this comment.
위 케이스의 통합테스트는 Repository를 통해 채널 정보를 저장하기 보다는 채널을 생성 API 호출, 채널 정보를 수정하는 API 호출, 채널 정보가 수정되었는지 조회하는 API 호출하는 방법으로 진행하면 좋을 것 같아요.
- given 영역에는 채널 생성 API 호출
- when 영역에는 채널 정보 수정 API 호출
- then 영역에는 채널 정보 조회 API 호출 후 검증
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요구사항
기본
심화
주요 변경사항
스크린샷
멘토에게