Skip to content

[WTH-98] 일정 준비물 필수 제거 #234

Merged
seokjun01 merged 5 commits intodevelopfrom
WTH-98-Weeth-일정-준비물-필수-제거-BE
Jan 9, 2026

Hidden character warning

The head ref may contain hidden characters: "WTH-98-Weeth-\uc77c\uc815-\uc900\ube44\ubb3c-\ud544\uc218-\uc81c\uac70-BE"
Merged

[WTH-98] 일정 준비물 필수 제거 #234
seokjun01 merged 5 commits intodevelopfrom
WTH-98-Weeth-일정-준비물-필수-제거-BE

Conversation

@seokjun01
Copy link
Copy Markdown
Collaborator

@seokjun01 seokjun01 commented Jan 9, 2026

📌 PR 내용

일정 생성 시 준비물 필드 필수가 아닌 선택 (즉 유효성 검증제거)으로 변경하였습니다

EventDTO 부분 save, update부분 NotNull 제거하였습니다.

🔍 PR 세부사항

테스트 의존성 버전이 충돌나서 빌드가 되지않아 2.0.1 에서 1.19.8로 변경되었습니다.
이에따라 TestContainerConfig 부분 Import 패키지 및 반환타입을 제네릭으로 변경하였습니다.
스웨거로는 아직 API요청이 제대로 먹지않아, 포스트맨 테스트 결과 로컬 정상 동작 확인하였습니다!

📸 관련 스크린샷

-Request Body 요청에 , 준비물 빼고 요청(선택)
스크린샷 2026-01-09 오후 5 49 15

-로컬DB
스크린샷 2026-01-09 오후 5 49 29


📝 주의사항


✅ 체크리스트

  • 리뷰어 설정
  • Assignee 설정
  • Label 설정
  • 제목 양식 맞췄나요? (ex. [WTH-01] PR 템플릿 수정)
  • 변경 사항에 대한 테스트

Summary by CodeRabbit

변경 사항

  • 버그 수정
    • 스케줄 생성 및 수정 시 필수 항목 필드의 입력 검증 요구사항을 완화했습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@seokjun01 seokjun01 requested review from hyxklee and jj0526 January 9, 2026 08:53
@seokjun01 seokjun01 self-assigned this Jan 9, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 9, 2026

워크스루

두 파일에서 간단한 변경이 수행되었습니다. ScheduleDTO의 requiredItem 필드에서 @NotBlank 검증 제약이 제거되었으며, TestContainersConfig에서는 메서드 체이닝 들여쓰기가 개선되었습니다.

변경 사항

응집(Cohort) / 파일 요약
검증 제약 제거
src/main/java/leets/weeth/domain/schedule/application/dto/ScheduleDTO.java
ScheduleDTO.SaveScheduleDTO.Update 레코드의 requiredItem 필드에서 @NotBlank 검증 애너테이션 제거
포맷팅 개선
src/test/java/leets/weeth/config/TestContainersConfig.java
.withReuse(true) 메서드 체이닝의 들여쓰기 포맷팅 조정

예상 코드 리뷰 노력

🎯 1 (Trivial) | ⏱️ ~3 minutes

검증 제약을 제거하고 ✨
형식을 다시 정렬하는
작은 변화들아
코드의 정원을 더 자유롭게 해주네 🐰🌱

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 주요 변경사항인 일정 준비물 필수 유효성 검증 제거를 명확하게 요약하고 있습니다.
Description check ✅ Passed PR 설명은 필수 섹션(PR 내용, PR 세부사항, 관련 스크린샷, 체크리스트)을 모두 포함하고 있으며 변경사항을 충분히 설명하고 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5daa939 and 3a05502.

📒 Files selected for processing (1)
  • src/test/java/leets/weeth/config/TestContainersConfig.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/test/java/leets/weeth/config/TestContainersConfig.java

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@seokjun01 seokjun01 added the fix label Jan 9, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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로 잘못 표시될 가능성

다음 개선이 필요합니다:

  1. entity 클래스에서 requiredItem 필드에 @Column(nullable = true) 명시 또는 update 로직에서 blank 체크 추가
  2. 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

📥 Commits

Reviewing files that changed from the base of the PR and between b9f2023 and 5daa939.

📒 Files selected for processing (4)
  • build.gradle
  • src/main/java/leets/weeth/domain/schedule/application/dto/ScheduleDTO.java
  • src/test/java/leets/weeth/config/TestContainersConfig.java
  • src/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

Comment thread build.gradle
Comment on lines 55 to 59
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'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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]
  • 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 버전을 관리합니다. 현재 코드는 다음 두 가지 문제가 있습니다:

  1. junit-jupiter 5.8.1은 outdated: Spring Boot 3.5.7이 관리하는 버전은 5.8.2입니다. 명시적 고정으로 인해 Boot가 권장하는 버전보다 뒤쳐져 있습니다.
  2. 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.

Suggested change
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'

Copy link
Copy Markdown
Collaborator

@jj0526 jj0526 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

준비물 유효성 검증 삭제한거 확인했습니다 수고하셨어요

@seokjun01 seokjun01 merged commit da89d35 into develop Jan 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants