Conversation
워크스루두 파일에서 간단한 변경이 수행되었습니다. ScheduleDTO의 requiredItem 필드에서 변경 사항
예상 코드 리뷰 노력🎯 1 (Trivial) | ⏱️ ~3 minutes 시
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/main/java/leets/weeth/domain/schedule/application/dto/ScheduleDTO.java (1)
25-44:requiredItem선택값화에 따른 null-safety와 OpenAPI 스키마 표현 개선 필요Line 29, 40에서
@NotBlank제거로requiredItem은 null/empty string/whitespace 입력을 모두 허용합니다. 확인 결과:
- entity.updateUpperClass() (line 50):
dto.requiredItem()을 검증 없이 직접 할당 → null 입력 시 NPE 우려 없으나 null 저장 가능- DB 컬럼:
@Column(nullable=...)명시 없음 → 기본적으로 nullable 상태- OpenAPI 스키마:
@Schema어노테이션 미적용 → requiredItem이 선택 필드임을 명시하지 않아 Swagger UI에서 required로 잘못 표시될 가능성다음 개선이 필요합니다:
- entity 클래스에서
requiredItem필드에@Column(nullable = true)명시 또는 update 로직에서 blank 체크 추가- DTO의
requiredItem필드에@Schema(nullable = true, requiredMode = NOT_REQUIRED)추가하여 OpenAPI 스키마에서 선택 필드임을 명확히 표시src/test/java/leets/weeth/config/TestContainersConfig.java (1)
6-21: 반환 타입을MySQLContainer<?>로 변경하고withReuse()동작 환경을 명확히 하세요Line 16의 반환 타입이 raw
MySQLContainer이지만 Line 17에서MySQLContainer<?>로 선언되어 타입이 불일치합니다. Testcontainers의 자체 참조 제네릭(self-referential generic) 설계상 raw 타입은 타입 안전성을 잃고 컴파일러 경고를 생성하므로, 반환 타입을MySQLContainer<?>로 맞춰야 합니다.또한
withReuse(true)는 로컬 개발 환경 전용 실험 기능이며, 동작하려면 환경 변수(TESTCONTAINERS_REUSE_ENABLE=true) 또는~/.testcontainers.properties설정이 필수입니다. CI 환경에서는 안전 장치(reaper 비활성화, 격리 문제 등) 때문에 적합하지 않으므로, 이러한 조건을 주석이나 문서로 명시하는 것이 안전합니다.제안 diff
@TestConfiguration public class TestContainersConfig { @Bean @ServiceConnection - public MySQLContainer mysqlContainer() { + public MySQLContainer<?> mysqlContainer() { MySQLContainer<?> container = new MySQLContainer<>(DockerImageName.parse(MYSQL_IMAGE)); + // withReuse(true)는 로컬 개발 환경에서만 사용 가능 + // CI에서는 TESTCONTAINERS_REUSE_ENABLE 환경 변수가 비활성화되어야 함 container.withReuse(true); return container; } }
🧹 Nitpick comments (1)
src/test/java/leets/weeth/config/TestContainersTest.java (1)
9-23: MySQLContainer raw 타입 주입은MySQLContainer<?>로 정리 권장 (경고/타입 안정성)
Line 17에서 raw 타입이라 컴파일 경고가 날 수 있고, Line 9/Config 쪽과도 타입이 어긋나 보입니다. 테스트 출력(Line 23)도 가능하면 로거로 바꾸거나 제거하는 편이 깔끔합니다.Proposed diff
import static org.assertj.core.api.AssertionsForInterfaceTypes.*; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ import org.springframework.context.annotation.Import; import org.testcontainers.containers.MySQLContainer; @@ class TestContainersTest { @Autowired - private MySQLContainer mysqlContainer; + private MySQLContainer<?> mysqlContainer; @@ void 설정파일로_주입된_컨테이너_정상_동작_테스트() { assertThat(mysqlContainer).isNotNull(); assertThat(mysqlContainer.isRunning()).isTrue(); - System.out.println("Container JDBC URL: " + mysqlContainer.getJdbcUrl()); + // 필요 시 logger 사용 권장 (테스트 표준 출력 노이즈 방지) } }
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
build.gradlesrc/main/java/leets/weeth/domain/schedule/application/dto/ScheduleDTO.javasrc/test/java/leets/weeth/config/TestContainersConfig.javasrc/test/java/leets/weeth/config/TestContainersTest.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
| testImplementation "org.junit.jupiter:junit-jupiter:5.8.1" | ||
| testImplementation "org.testcontainers:testcontainers:2.0.1" | ||
| testImplementation "org.testcontainers:testcontainers-junit-jupiter:2.0.1" | ||
| testImplementation "org.testcontainers:testcontainers-mysql:2.0.1" | ||
| testImplementation "org.testcontainers:testcontainers:1.19.8" | ||
| testImplementation "org.testcontainers:junit-jupiter:1.19.8" | ||
| testImplementation "org.testcontainers:mysql:1.19.8" | ||
| testImplementation 'org.springframework.boot:spring-boot-testcontainers' |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Spring Boot 3.5.7 testcontainers version management dependency
💡 Result:
Short answer: Spring Boot 3.5.7 manages Testcontainers versions for you via its dependency-management (spring-boot-dependencies). If you use the Spring Boot BOM (or the Spring Boot Gradle plugin) you can add Testcontainers artifacts (e.g. org.testcontainers:testcontainers, org.testcontainers:junit-jupiter, specific modules) in test scope without specifying a version — the Boot BOM supplies the version. [1][2][3]
If you need to override or pick a newer Testcontainers release, either:
- Import the Testcontainers BOM explicitly (recommended) after the Boot BOM in Maven dependencyManagement (or in Gradle importBom) so its versions win:
- Maven example:
org.testcontainers
testcontainers-bom
2.x.y
pom
import
(then add test dependencies without versions). [2]
- Maven example:
- Or set the testcontainers.version/testcontainers-bom property in your build to the desired version to override Boot’s managed version.
Notes:
- Spring Boot also publishes a spring-boot-testcontainers module (3.5.7) that integrates service-connections; include it as test dependency if you use Boot’s Testcontainers support. [1][4]
- Check which Testcontainers version Boot 3.5.7 manages in spring-boot-dependencies for that release (Boot’s dependency-version page / BOM lists the concrete org.testcontainers versions). [3]
Sources:
- Spring Boot testing / Testcontainers integration docs. [1]
- Testcontainers project docs / BOM usage. [2]
- Spring Boot dependency versions / BOM listing (shows the Testcontainers versions Boot manages). [3]
- spring-boot-testcontainers artifact info. [4]
🌐 Web query:
testcontainers 1.19.8 spring-boot-testcontainers compatibility
💡 Result:
Short answer: Yes — Testcontainers 1.19.8 is the managed/tested Testcontainers version used by Spring Boot (3.2.x series), so using org.testcontainers:testcontainers:1.19.8 with Spring Boot's spring-boot-testcontainers (3.2.x) is supported; prefer using the Spring Boot dependency management/BOM to keep versions aligned. [1][2][3]
Sources:
- Spring Boot docs — Testcontainers guidance. [1]
- Spring Boot 3.2 dependency versions listing (shows org.testcontainers = 1.19.8). [2]
- spring-boot-testcontainers artifact info (examples for 3.2.x). [3]
🌐 Web query:
junit-jupiter 5.8.1 Spring Boot 3.5.7 compatibility
💡 Result:
Short answer: Yes—JUnit Jupiter 5.8.1 will generally work with Spring Boot 3.5.7, but Spring Boot 3.5.x manages and ships JUnit Jupiter 5.8.2 by default, so it's recommended to use the Boot-managed version (or align to 5.8.2) to avoid subtle mismatches. [1][2][3]
Sources:
- Spring Boot 3.5.7 release announcement. [1]
- Spring Boot dependency versions (shows junit-jupiter 5.8.2 used by Boot). [2]
- JUnit Jupiter 5.8.1 release notes (release date and details). [3]
Testcontainers와 JUnit 버전 관리를 Boot BOM에 맡기기를 권장합니다
Spring Boot 3.5.7은 의존성 관리 BOM을 통해 Testcontainers와 JUnit Jupiter 버전을 관리합니다. 현재 코드는 다음 두 가지 문제가 있습니다:
- junit-jupiter 5.8.1은 outdated: Spring Boot 3.5.7이 관리하는 버전은 5.8.2입니다. 명시적 고정으로 인해 Boot가 권장하는 버전보다 뒤쳐져 있습니다.
- testcontainers 명시적 고정의 유지보수 부담: Boot의 BOM을 통해 자동으로 관리받으면 버전 스큐 위험이 없고, 향후 Boot 업그레이드 시 의존성이 자동으로 정렬됩니다.
권장 방안: 다음과 같이 수정하여 Boot의 관리 버전을 사용하세요:
Boot 관리 버전 사용 (권장)
dependencies {
// Test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
- testImplementation "org.junit.jupiter:junit-jupiter:5.8.1"
- testImplementation "org.testcontainers:testcontainers:1.19.8"
- testImplementation "org.testcontainers:junit-jupiter:1.19.8"
- testImplementation "org.testcontainers:mysql:1.19.8"
+ testImplementation "org.junit.jupiter:junit-jupiter"
+ testImplementation "org.testcontainers:testcontainers"
+ testImplementation "org.testcontainers:junit-jupiter"
+ testImplementation "org.testcontainers:mysql"
testImplementation 'org.springframework.boot:spring-boot-testcontainers'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| testImplementation "org.junit.jupiter:junit-jupiter:5.8.1" | |
| testImplementation "org.testcontainers:testcontainers:2.0.1" | |
| testImplementation "org.testcontainers:testcontainers-junit-jupiter:2.0.1" | |
| testImplementation "org.testcontainers:testcontainers-mysql:2.0.1" | |
| testImplementation "org.testcontainers:testcontainers:1.19.8" | |
| testImplementation "org.testcontainers:junit-jupiter:1.19.8" | |
| testImplementation "org.testcontainers:mysql:1.19.8" | |
| testImplementation 'org.springframework.boot:spring-boot-testcontainers' | |
| testImplementation "org.junit.jupiter:junit-jupiter" | |
| testImplementation "org.testcontainers:testcontainers" | |
| testImplementation "org.testcontainers:junit-jupiter" | |
| testImplementation "org.testcontainers:mysql" | |
| testImplementation 'org.springframework.boot:spring-boot-testcontainers' |
jj0526
left a comment
There was a problem hiding this comment.
준비물 유효성 검증 삭제한거 확인했습니다 수고하셨어요
📌 PR 내용
일정 생성 시 준비물 필드 필수가 아닌 선택 (즉 유효성 검증제거)으로 변경하였습니다
EventDTO 부분 save, update부분 NotNull 제거하였습니다.
🔍 PR 세부사항
테스트 의존성 버전이 충돌나서 빌드가 되지않아 2.0.1 에서 1.19.8로 변경되었습니다.
이에따라 TestContainerConfig 부분 Import 패키지 및 반환타입을 제네릭으로 변경하였습니다.
스웨거로는 아직 API요청이 제대로 먹지않아, 포스트맨 테스트 결과 로컬 정상 동작 확인하였습니다!
📸 관련 스크린샷
-Request Body 요청에 , 준비물 빼고 요청(선택)

-로컬DB

📝 주의사항
✅ 체크리스트
Summary by CodeRabbit
변경 사항
✏️ Tip: You can customize this high-level summary in your review settings.