Skip to content

Commit c99432c

Browse files
authored
[refactor/#450] 테스트 패키지 구조와 네이밍 컨벤션 정리 (#451)
* improve: 불필요한 Spring 테스트 삭제 * docs: 컨벤션은 별도 패키지로 분리 * docs: ddd 관련 문서를 ddd 패키지 하위로 이동 * docs: 테스트 컨벤션 작성 * refactor: 시간 관련 계약을 고정값으로 하여 테스트 안전성 강화 * refactor: 통합 테스트 네이밍에서 Controller 제거 * refactor: useraccount 도메인의 fixture 정리 * refactor: post 도메인과 source 도메인의 fixture 소유권 정리 * recommendation fixture 소유권 정리 * refactor: activity 도메인 fixture 소유권 정리 * refactor: post 도메인 테스트 fixture 소유권 정리 * refactor: auth 패키지 fixture 소유권 정리 * refactor: useraccount 테스트 fixture 소유권 정리 * refactor: source 테스트 fixture 소유권 정리 * refactor: recommendation 테스트 fixture 소유권 정리 * post 테스트 fixture 소유권 정리 2 * refactor: 테스트 fixture 사용 일괄 정리 * docs: 테스트 실행 계약 정리 * docs: 레거시 코드들은 옮기지 않음을 명시 * docs: 테스트 네이밍 최신화 * docs: 테스트 메서드 네이밍 컨벤션 보강 * test: auth 패키지 구조와 메서드명 정리 * test: useraccount 패키지 구조와 메서드명 정리 * test: activity 패키지 구조와 메서드명 정리 Constraint: 도메인 단위로 Nested 구조와 테스트 메서드명을 함께 정리 Confidence: high Scope-risk: moderate Tested: ./gradlew compileTestJava; ./gradlew test -PexcludeIntegration --tests 'com.techfork.activity.*'; activity integration tests with temporary MySqlRedisIntegrationTestBase restored afterward Not-tested: full test suite * test: post 패키지 구조와 메서드명 정리 Constraint: 도메인 단위로 Nested 구조와 테스트 메서드명을 함께 정리 Confidence: high Scope-risk: moderate Tested: ./gradlew compileTestJava; ./gradlew test -PexcludeIntegration --tests 'com.techfork.post.*'; post integration tests with temporary MySqlRedisIntegrationTestBase restored afterward Not-tested: full test suite * test: personalization 패키지 구조와 메서드명 정리 Constraint: 도메인 단위로 Nested 구조와 테스트 메서드명을 함께 정리 Confidence: high Scope-risk: moderate Tested: ./gradlew compileTestJava; ./gradlew test -PexcludeIntegration --tests 'com.techfork.personalization.*'; personalization integration test with temporary MySqlRedisIntegrationTestBase restored afterward Not-tested: full test suite * test: recommendation 패키지 구조와 메서드명 정리 Constraint: legacy domain/recommendation root 유지 Confidence: medium Scope-risk: moderate Tested: ./gradlew compileTestJava; ./gradlew test -PexcludeIntegration --tests 'com.techfork.domain.recommendation.*' Not-tested: RecommendationIntegrationTest blocked by Elasticsearch container startup timeout; MySqlRedisIntegrationTestBase check blocked by schema-validation mismatch * test: source 패키지 구조와 메서드명 정리 Constraint: legacy domain/source root 유지 Confidence: medium Scope-risk: moderate Tested: ./gradlew compileTestJava; ./gradlew test -PexcludeIntegration --tests 'com.techfork.domain.source.*' Not-tested: RssCrawlingJobIntegrationTest blocked by MySqlRedisIntegrationTestBase schema-validation mismatch * test: search 패키지 구조와 메서드명 정리 Constraint: legacy domain/search root 유지 Confidence: high Scope-risk: narrow Tested: ./gradlew compileTestJava; ./gradlew test -PexcludeIntegration --tests 'com.techfork.domain.search.*' Not-tested: full test suite * test: global 테스트 구조와 메서드명 정리 Constraint: shared global test support files 제외 Confidence: high Scope-risk: narrow Tested: ./gradlew compileTestJava; ./gradlew test -PexcludeIntegration --tests 'com.techfork.global.*' Not-tested: full test suite * test: 일반 통합 테스트에서 ES 컨테이너 의존 분리 일반 integrationTest 레인은 MySQL/Redis base를 기본으로 맞추고, ES가 필요한 평가/검색 품질 검증은 기존 IntegrationTestBase에 남긴다. 테스트 전용 H2 설정은 @TestConfiguration으로 제한해 SpringBootTest 스캔에 새지 않게 한다. Constraint: CI에서 Elasticsearch Testcontainer 시작 timeout이 일반 통합 테스트 컨텍스트까지 실패시킴 Rejected: 모든 integrationTest에서 IntegrationTestBase 유지 | ES 비사용 API 테스트가 ES 컨테이너 상태에 종속됨 Confidence: high Scope-risk: moderate Directive: ES 실기동이 필요한 테스트만 IntegrationTestBase를 사용하고 일반 API IT는 MySqlRedisIntegrationTestBase를 사용한다 Tested: ./gradlew integrationTest; ./gradlew integrationTest --tests 'com.techfork.auth.integration.AuthIntegrationTest'; ./gradlew integrationTest --tests 'com.techfork.activity.bookmark.integration.BookmarkIntegrationTest'; ./gradlew test --tests 'com.techfork.domain.source.batch.RssFeedReaderTest.enclosureExistsWithoutMedia_ExtractsThumbnail' -PexcludeIntegration Not-tested: ./gradlew test -PexcludeIntegration 전체 레인은 RssFeedReaderTest enclosure timeout 플래키 1건으로 실패 후 단일 재실행 통과
1 parent b413fb1 commit c99432c

150 files changed

Lines changed: 7248 additions & 6767 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ TechFork is a Spring Boot 3.5.9 / Java 17 backend that crawls Korean tech blogs,
5252
- Do not trust docs over code when they disagree; example: scheduler docs mention hourly behavior, but `RssCrawlingScheduler` currently runs daily at 05:00 KST.
5353

5454
## UNIQUE STYLES
55-
- Commit format: `<type>: <subject>` (`docs/commit-convention.md`).
56-
- PR title format: `[type/#issue] description` (`docs/pr-convention.md`).
55+
- Commit format: `<type>: <subject>` (`docs/convention/commit-convention.md`).
56+
- PR title format: `[type/#issue] description` (`docs/convention/pr-convention.md`).
5757
- Korean messages/comments are normal in code and docs.
5858
- Evaluation outputs are checked into `src/test/resources/` as JSON reports.
5959
- Operational knowledge is split across docs, compose files, shell scripts, and workflows rather than a single ops README.
@@ -70,7 +70,7 @@ docker compose -f docker/docker-compose.local.yml up -d
7070
```
7171

7272
## NOTES
73-
- High-value docs: `docs/source-package.md`, `docs/SCHEDULER_GUIDE.md`, `docs/commit-convention.md`, `docs/pr-convention.md`.
73+
- High-value docs: `docs/SCHEDULER_GUIDE.md`, `docs/ddd/domain-strategy.md`, `docs/ddd/ddd-test-refactoring-roadmap.md`, `docs/convention/commit-convention.md`, `docs/convention/pr-convention.md`.
7474
- `HELP.md` is Spring starter boilerplate; low signal compared with repo docs.
7575
- Child AGENTS live at:
7676
- `src/main/java/com/techfork/domain/source/AGENTS.md`

docs/AGENTS.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ This AGENTS.md scopes guidance to `docs`. Parent AGENTS guidance still applies u
1212
## Current Layout
1313

1414
### Files
15-
- `commit-convention.md`
16-
- `pr-convention.md`
1715
- `SCHEDULER_GUIDE.md`
1816

1917
### Subdirectories
20-
- None
18+
- `convention/`
19+
- `ddd/`
2120

2221
<!-- OMX:AGENTS-INIT:MANUAL:START -->
2322
## Local Notes
File renamed without changes.
File renamed without changes.

docs/convention/test-convention.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# 테스트 컨벤션
2+
3+
## 테스트 실행 레인 계약
4+
5+
테스트는 Gradle task와 JUnit tag 조합으로 실행 레인을 나눈다.
6+
7+
| 레인 | 실행 명령 | 태그 계약 | 용도 |
8+
| --- | --- | --- | --- |
9+
| unit / slice | `./gradlew test -PexcludeIntegration` | `integration`, `evaluation`, `evaluation-setup` 제외 | 일반 단위 테스트와 JPA slice 등 빠른 회귀 확인 |
10+
| default test | `./gradlew test` | `evaluation`, `evaluation-setup` 제외 | Gradle 기본 테스트. `integration` 태그는 제외하지 않으므로 빠른 로컬 루프에는 권장하지 않음 |
11+
| integration | `./gradlew integrationTest` | `integration` 포함, `evaluation`, `evaluation-setup` 제외 | `MySqlRedisIntegrationTestBase` 기반 API/트랜잭션/컨테이너 통합 검증 |
12+
| evaluation | `./gradlew evaluationTest` | `evaluation` 포함, `integration`, `evaluation-setup` 제외 | 검색/추천 품질 평가 |
13+
| evaluation-setup | `./gradlew evaluationSetup` | `evaluation-setup` 포함 | 평가 fixture 생성/export 등 사전 데이터 준비 |
14+
15+
- 빠른 리팩터링 검증 루프는 `./gradlew test -PexcludeIntegration`를 기본으로 한다.
16+
- `@SpringBootTest` 기반 일반 통합 테스트는 기본적으로 `MySqlRedisIntegrationTestBase`를 상속해 `integration` 레인에 둔다.
17+
- 빈 Spring context smoke test는 일반 `test` 레인에 두지 않는다. 유지가 필요하면 `integration` 레인 계약을 명확히 적용한다.
18+
- evaluation 하위 테스트는 일반 unit/integration 회귀 검증과 섞지 않는다.
19+
20+
## 패키지 컨벤션
21+
22+
- 테스트 패키지는 `com.techfork.<bounded-context>.<test-kind>`를 기본으로 한다.
23+
- 예: `post.domain`, `post.infrastructure`, `post.integration`, `useraccount.presentation.request`, `auth.integration`
24+
- `test-kind` 패키지는 테스트의 역할을 드러내는 이름을 사용한다.
25+
- 예: `domain`, `application`, `infrastructure`, `presentation`, `integration`, `fixture`
26+
- production 패키지가 아직 `com.techfork.domain.*`에 남아 있는 영역은 테스트도 legacy root를 유지한다.
27+
- legacy slice를 옮길 때는 production과 test를 같은 작업 단위에서 함께 옮긴다. 네이밍 정리만을 위해 테스트만 먼저 이동하지 않는다.
28+
- `src/test/java/com/techfork/evaluation`은 별도 evaluation lane이다. 해당 하위 패키지는 [로컬 가이드](../../src/test/java/com/techfork/evaluation/AGENTS.md)를 따른다.
29+
30+
## Legacy `domain/*` 유지/이관 기준
31+
32+
현재 production package가 `com.techfork.domain.*`에 남아 있는 영역은 테스트도 같은 legacy root를 유지한다.
33+
34+
- 현재 legacy 유지 대상:
35+
- `com.techfork.domain.source`
36+
- `com.techfork.domain.search`
37+
- `com.techfork.domain.recommendation`
38+
- 테스트만 먼저 `com.techfork.<context>`로 옮기지 않는다. production과 test의 root가 달라지면 IDE 탐색, package-private 접근, fixture 소유권 판단이 어긋날 수 있다.
39+
- legacy slice를 이관할 때는 다음을 같은 작업 단위로 묶는다.
40+
- production package 선언과 디렉터리 이동
41+
- test package 선언과 디렉터리 이동
42+
- fixture package와 import 경로 갱신
43+
- 문서/AGENTS/로드맵의 package 경로 갱신
44+
- 단순 네이밍 정리나 fixture 정리 작업에서는 legacy root를 유지하고, 이관은 별도 리팩터링 이슈로 분리한다.
45+
46+
## 네이밍 컨벤션
47+
48+
### 클래스명
49+
50+
| 대상 | 기본 이름 | 예외/비고 |
51+
| --- | --- | --- |
52+
| 도메인 객체/값 객체 | `{Subject}Test` | 예: `PostTest`, `UserTest` |
53+
| application/service 단위 테스트 | `{Subject}Test` | production class 이름을 따른다. 예: `PostQueryServiceTest` |
54+
| Repository 검증 테스트 | `{RepositoryName}Test` | `DataJpaTest` suffix를 기본값으로 쓰지 않는다. 예: `PostRepositoryTest` |
55+
| 같은 subject에 unit과 persistence slice가 공존하는 batch/reader/writer | `{Subject}DataJpaTest` 허용 | 예: `PostSummaryReaderTest` + `PostSummaryReaderDataJpaTest` |
56+
| HTTP/API 통합 테스트 | `{Context}IntegrationTest` | `Controller` suffix는 테스트 클래스명에서 제거한다. 예: `PostIntegrationTest`, `AuthIntegrationTest` |
57+
| API version이 같은 context 안에서 분리된 경우 | `{Context}V{N}IntegrationTest` | 예: `PostV2IntegrationTest` |
58+
| 이벤트/스케줄러/동시성/after-commit 통합 테스트 | 목적이 드러나는 suffix 허용 | 예: `ReadPostCommandServiceConcurrencyIntegrationTest`, `UserAccountAfterCommitEventIntegrationTest` |
59+
60+
### 메서드명
61+
62+
- 테스트 메서드는 `subject_condition_expectedResult` 형태를 기본으로 한다.
63+
- 예: `getBookmarks_Success_WithCursor`, `findByIdWithTechBlog_NotFound_ReturnsEmpty`
64+
- 행위가 `@Nested`로 충분히 묶였으면 condition/expectedResult 중심으로 짧게 써도 된다.
65+
- 예: `withCookie_ReturnsDeserializedAuthorizationRequest`
66+
- 단순 성공/실패만 표현하는 `*_Success`, `*_Fail`은 새 테스트에서 지양한다. 조건이나 관찰 결과를 함께 쓴다.
67+
- 기존 테스트를 대량 rename하지 않는다. 기능 변경/테스트 보강 시 해당 파일 안에서 자연스럽게 맞춘다.
68+
69+
### `@Nested` / `@DisplayName`
70+
71+
- `@Nested`는 행위, API endpoint, 시나리오 단위로 묶는다.
72+
- 예: `GET /api/v1/posts/{postId}`, `북마크 목록 조회`, `loadUser`
73+
- `Success`/`Failure`만 단독 최상위 그룹으로 남발하지 않는다. 더 큰 행위 그룹 아래에서 의미가 있을 때만 사용한다.
74+
- `@DisplayName`은 관찰 가능한 동작이나 기대 결과가 드러나도록 한글로 작성하는 것을 기본으로 한다.
75+
- HTTP/API 통합 테스트의 `@DisplayName`은 wire contract가 드러나도록 endpoint, 인증 여부, 응답 상태/필드를 표현한다.
76+
77+
## Fixture 컨벤션
78+
79+
- 여러 테스트 클래스에서 재사용하는 fixture는 소유 context의 `fixture` 패키지에 둔다.
80+
- 한 테스트 클래스에서만 쓰는 setup은 private helper method로 유지한다.
81+
- 서로 관련 없는 도메인을 묶는 global fixture 패키지는 만들지 않는다.
82+
- 순수 객체 fixture와 repository 저장 helper는 역할을 분리한다.
83+
- fixture에서는 `LocalDateTime.now()`보다 안정적인 기본 시간값을 우선 사용한다.
84+
- `ReflectionTestUtils`는 production factory가 의도적으로 숨긴 ID/state를 테스트에서 주입해야 할 때만 사용한다.
85+
86+
## 통합 테스트 컨벤션
87+
88+
- 일반 통합 테스트 base는 `MySqlRedisIntegrationTestBase`를 기본으로 사용한다.
89+
- `MySqlRedisIntegrationTestBase`는 MySQL/Redis 컨테이너만 띄우고 Elasticsearch 관련 bean/repository는 mock 처리한다.
90+
- Elasticsearch 실기동이 필요한 평가/검색 품질 검증은 일반 `integrationTest` 레인과 섞지 않고 별도 base/레인에서 실행한다.
91+
- 같은 `integrationTest` 레인 안에서는 base/config 조합을 불필요하게 나누지 않는다. Spring context cache key가 달라지면 Testcontainers lifecycle이 갈라져 CI 실행 시간이 늘어난다.
92+
93+
## 실행 명령
94+
95+
```bash
96+
./gradlew test -PexcludeIntegration
97+
./gradlew integrationTest
98+
./gradlew evaluationTest
99+
./gradlew evaluationSetup
100+
```
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# DDD 전환과 테스트 개선 로드맵
22

33
> 목적: TechFork 서버를 DDD 관점으로 점진적으로 개선하면서, 아직 부족한 테스트 코드를 어떤 순서로 작성·개선할지 정리한다.
4-
> 관련 문서: [`docs/ubiquitous-language/README.md`](./ubiquitous-language/README.md)
4+
> 관련 문서: [`docs/ddd/ubiquitous-language/README.md`](./ubiquitous-language/README.md)
55
> 기준 시점: **2026-06-21, #432 Auth / Security 문서 동기화 시점**
66
77
## 1. 결론
@@ -84,8 +84,8 @@ DDD 목표 지도 작성
8484

8585
산출물:
8686

87-
- `docs/ubiquitous-language/README.md`
88-
- `docs/ubiquitous-language/` (컨텍스트별 glossary)
87+
- `docs/ddd/ubiquitous-language/README.md`
88+
- `docs/ddd/ubiquitous-language/` (컨텍스트별 glossary)
8989

9090
포함되어야 할 내용:
9191

@@ -127,10 +127,10 @@ DDD 리팩터링에 들어가기 전에 테스트 현황을 먼저 파악한다.
127127
권장 산출물:
128128

129129
```text
130-
docs/test-gap-analysis.md
130+
docs/ddd/test-gap-analysis.md
131131
```
132132

133-
2026-04-28 현재 `docs/test-gap-analysis.md`는 이미 존재하며, 이후 로드맵 업데이트와 함께 같이 최신화하는 것을 기본 원칙으로 둔다.
133+
2026-04-28 현재 `docs/ddd/test-gap-analysis.md`는 이미 존재하며, 이후 로드맵 업데이트와 함께 같이 최신화하는 것을 기본 원칙으로 둔다.
134134

135135
분석 항목:
136136

File renamed without changes.
File renamed without changes.
Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# TechFork 테스트 갭 분석
22

3+
> Historical snapshot: DDD 전환 과정에서 작성된 테스트 갭 분석 문서입니다. 최신 테스트 컨벤션은 `src/test/AGENTS.md`를 따릅니다.
34
> 목적: DDD 전환과 테스트 개선 로드맵을 실행하기 전에, 현재 테스트가 어떤 영역을 보호하고 있고 어떤 영역이 비어 있는지 분석한다.
4-
> 관련 문서: [`docs/ubiquitous-language/README.md`](./ubiquitous-language/README.md), [`docs/ddd-test-refactoring-roadmap.md`](./ddd-test-refactoring-roadmap.md)
5+
> 관련 문서: [`docs/ddd/ubiquitous-language/README.md`](./ubiquitous-language/README.md), [`docs/ddd/ddd-test-refactoring-roadmap.md`](./ddd-test-refactoring-roadmap.md)
56
> 기준 시점: **2026-06-03, #411 병합 후 `docs/#412` 시작 시점**
67
78
## 1. 분석 요약
89

910
현재 테스트는 **Controller/Repository/Service 단위의 기존 기능 회귀 테스트는 꽤 많이 쌓여 있지만, DDD 전환에 필요한 애그리거트 단위 테스트와 핵심 개인화/추천/검색 알고리즘 테스트가 부족한 상태**다.
1011

11-
테스트 보강 우선순위는 `docs/domain-strategy.md`의 하위 도메인 분류를 따른다. 즉, **핵심 하위 도메인인 개인화 기술 콘텐츠 발견(Search/Recommendation), 사용자 관심/행동 기반 개인화 모델링(Personalization Profile/Activity), 기술 게시글 이해/풍부화(Post enrichment)** 를 먼저 보호한다.
12+
테스트 보강 우선순위는 `docs/ddd/domain-strategy.md`의 하위 도메인 분류를 따른다. 즉, **핵심 하위 도메인인 개인화 기술 콘텐츠 발견(Search/Recommendation), 사용자 관심/행동 기반 개인화 모델링(Personalization Profile/Activity), 기술 게시글 이해/풍부화(Post enrichment)** 를 먼저 보호한다.
1213

1314
요약하면 다음과 같다.
1415

@@ -195,8 +196,8 @@ Source는 DDD 전환 초반에는 큰 변경을 피하고, 나중에 이벤트
195196

196197
| 테스트 | 성격 | 주요 커버 |
197198
|---|---|---|
198-
| `PostControllerIntegrationTest` | integration | v1 API, 상세/회사/최근/회사별 조회, auth 포함 응답 |
199-
| `PostControllerV2IntegrationTest` | integration | v2 회사 목록, 다중 회사, 커서 페이징, 최신/인기 정렬 |
199+
| `PostIntegrationTest` | integration | v1 API, 상세/회사/최근/회사별 조회, auth 포함 응답 |
200+
| `PostV2IntegrationTest` | integration | v2 회사 목록, 다중 회사, 커서 페이징, 최신/인기 정렬 |
200201
| `PostRepositoryTest` | JPA | company/recent/popular/detail 쿼리, cursor, company detail |
201202
| `PostQueryServiceTest` | unit/mock | 목록/상세 조회, 키워드/북마크 여부 조합 |
202203
| `PostTest` | unit | RssFeedItem 생성, summary 갱신, keyword 재구성 |
@@ -268,8 +269,8 @@ ContentChunkerServiceTest
268269

269270
| 테스트 | 성격 | 주요 커버 |
270271
|---|---|---|
271-
| `OnboardingControllerIntegrationTest` | integration | 관심사 목록, 온보딩 완료, validation |
272-
| `UserControllerIntegrationTest` | integration | 계정 프로필 조회/수정, 탈퇴 |
272+
| `OnboardingIntegrationTest` | integration | 관심사 목록, 온보딩 완료, validation |
273+
| `UserIntegrationTest` | integration | 계정 프로필 조회/수정, 탈퇴 |
273274
| `UserRepositoryTest` | JPA | 관심사 fetch, 활성 사용자 조회, 탈퇴 사용자 제외 |
274275
| `UserInterestCategoryRepositoryTest` | JPA | 관심 카테고리/키워드 fetch, cascade, mapping |
275276
| `InterestCommandServiceTest` | unit/mock | 관심사 저장, 기존 관심사 clear, invalid keyword category, 관심사 수정 이벤트 발행 |
@@ -333,7 +334,7 @@ UserTest
333334

334335
| 테스트 | 성격 | 주요 커버 |
335336
|---|---|---|
336-
| `RecommendationControllerIntegrationTest` | integration | 추천 목록 조회, 랭킹 순서, 북마크 상태 조합 |
337+
| `RecommendationIntegrationTest` | integration | 추천 목록 조회, 랭킹 순서, 북마크 상태 조합 |
337338
| `RecommendationQueryServiceTest` | unit/mock | 추천 목록 조회, 북마크 상태 조합, 빈 목록 |
338339
| `RecommendationConverterTest` | unit/mock | thumbnail optimization |
339340
| `PersonalizedProfileGeneratedEventListenerTest` | unit/mock | 이벤트 수신 후 스냅샷 기반 추천 생성, 예외 격리, AFTER_COMMIT annotation |
@@ -413,7 +414,7 @@ evaluation suite는 무겁고 runtime/profile/fixture 의존이 강하므로 품
413414
| P1 | BM25 query builder 구조 테스트 | dis_max/exact/fuzzy/chunk 구조 회귀 방지 |
414415
| P1 | Semantic KNN field/boost 테스트 | title/summary/chunk embedding field 회귀 방지 |
415416
| P1 | metadata attachment 테스트 | viewCount, isBookmarked 조합 보호 |
416-
| P2 | `SearchControllerIntegrationTest` | API contract 보호 |
417+
| P2 | `SearchIntegrationTest` | API contract 보호 |
417418

418419
#### 추천 추가 테스트
419420

@@ -427,7 +428,7 @@ SearchServiceImplTest
427428
```
428429

429430
```text
430-
SearchControllerIntegrationTest
431+
SearchIntegrationTest
431432
- 비로그인 검색은 일반 검색을 호출한다.
432433
- 로그인 검색은 개인화 검색을 호출한다.
433434
- bm25 debug endpoint가 동작한다.
@@ -446,8 +447,8 @@ SearchControllerIntegrationTest
446447
| `KakaoLoginCommandServiceTest` | unit/mock | iOS 직접 Kakao login 신규/기존 사용자 |
447448
| `KakaoOAuthServiceTest` | unit/mock | Kakao user info response mapping success/failure |
448449
| `KakaoSocialIdTest` | unit | Kakao REST/OIDC social id 정규화 |
449-
| `AuthControllerIntegrationTest` | integration | refresh/logout/kakao login API |
450-
| `DeveloperTokenControllerIntegrationTest` | integration | developer token 생성, 권한/인증 실패 |
450+
| `AuthIntegrationTest` | integration | refresh/logout/kakao login API |
451+
| `DeveloperTokenIntegrationTest` | integration | developer token 생성, 권한/인증 실패 |
451452
| `SecurityIntegrationTest` | integration | 인증/인가, 토큰 오류, 권한, 탈퇴 사용자 |
452453
| `JwtUtilTest` | unit | refresh token 단독 발급과 token type |
453454
| `JwtAuthenticationFilterTest` | unit/mock | access token filter, cache hit/miss, invalid token |
@@ -565,7 +566,7 @@ src/main/java/com/techfork/domain/notification/entity/NotificationToken.java
565566
| `RecommendationSchedulerTest` | 일일 추천 생성 스케줄 보호 | 운영 배치 안정화 |
566567
| `RecommendedPostRepositoryTest` | rank order/delete/unique 보호 | RecommendationSet 도입 전 |
567568
| `RecommendationHistoryTest` | 이력화/click 기록 보호 | 추천 이력 모델 정리 |
568-
| `SearchControllerIntegrationTest` | 검색 API contract 보호 | Search API 경계 정리 |
569+
| `SearchIntegrationTest` | 검색 API contract 보호 | Search API 경계 정리 |
569570
| `TechnicalPostIndexed` event contract tests | 색인 완료 후속 이벤트 보호 | Phase 6 후속 이벤트 도입 |
570571

571572
### P1. DDD 전환 중 보강
@@ -599,13 +600,13 @@ src/main/java/com/techfork/domain/notification/entity/NotificationToken.java
599600

600601
## 7. 테스트 작성 순서 제안
601602

602-
`docs/ddd-test-refactoring-roadmap.md`의 실행 순서를 테스트 관점으로 더 구체화하면 다음과 같다.
603+
`docs/ddd/ddd-test-refactoring-roadmap.md`의 실행 순서를 테스트 관점으로 더 구체화하면 다음과 같다.
603604

604605
```text
605606
1. 현재 문서/테스트 인벤토리와 DDD 경계 최신화 유지
606607
2. MmrServiceTest 작성
607608
3. RecommendationCommand/Scheduler/History/Repository 테스트 보강
608-
4. SearchControllerIntegrationTest 및 ranking edge-case 테스트 보강
609+
4. SearchIntegrationTest 및 ranking edge-case 테스트 보강
609610
5. PersonalizationProfile parsing edge-case와 outbox/retry 필요성 검토
610611
6. TechnicalPostIndexed 이벤트 contract 테스트 준비
611612
```
@@ -630,7 +631,7 @@ src/main/java/com/techfork/domain/notification/entity/NotificationToken.java
630631
- RecommendedPostRepositoryTest / RecommendationHistoryTest 추가
631632
632633
작업 4: 검색 API/순위 edge-case 테스트
633-
- SearchControllerIntegrationTest 추가
634+
- SearchIntegrationTest 추가
634635
- SearchServiceImplTest ranking/fallback edge-case 확장
635636
636637
작업 5: 후속 이벤트 contract 테스트
@@ -721,7 +722,7 @@ src/test/java/com/techfork/domain
721722
service
722723
SearchServiceImplTest
723724
controller
724-
SearchControllerIntegrationTest
725+
SearchIntegrationTest
725726
```
726727

727728
주의:

0 commit comments

Comments
 (0)