fix(home): AI 캐릭터 홈 노출 개수를 늘린다

This commit is contained in:
2026-07-09 18:27:49 +09:00
parent c706c73b05
commit 15b55704e0
4 changed files with 21 additions and 5 deletions
@@ -243,6 +243,22 @@ class HomeRecommendationControllerTest @Autowired constructor(
.andExpect(jsonPath("$.data.lives").isArray)
}
@Test
@DisplayName("메인 홈 통합 조회는 AI 캐릭터를 최신 스냅샷 기준 최대 20개까지 반환한다")
fun shouldReturnTwentyAiCharactersOnHomeRecommendations() {
(1..22).forEach { index ->
val character = saveAiCharacter("home-ai-character-$index")
saveRecommendationSnapshot(character.id!!)
}
entityManager.flush()
entityManager.clear()
mockMvc.perform(get("/api/v2/home/recommendations"))
.andExpect(status().isOk)
.andExpect(jsonPath("$.success").value(true))
.andExpect(jsonPath("$.data.aiCharacters.length()").value(20))
}
@Test
@DisplayName("메인 홈 통합 조회 실패는 응답 시간과 함께 로그로 관측된다")
fun shouldLogHomeRecommendationFailure(output: CapturedOutput) {