-
Notifications
You must be signed in to change notification settings - Fork 1
[FIX] 그룹 채팅 퇴장/강퇴 unread 집계 보정 및 테스트 안정화 #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The head ref may contain hidden characters: "fix/#86/\uADF8\uB8F9-\uCC44\uD305-\uBA64\uBC84-\uD1F4\uC7A5\uCD94\uBC29-\uC2DC-\uBBF8\uC77D\uC74C-\uCE74\uC6B4\uD2B8-\uC9D1\uACC4-\uC624\uB958"
Changes from all commits
9226b88
ae15127
2dca8ae
9172399
56e33ce
9f250fa
86869e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,4 +52,7 @@ pinpoint-agent/tools/ | |
| .claude | ||
|
|
||
| ### env ### | ||
| .env | ||
| .env | ||
|
|
||
| # macOS artefacts | ||
| .DS_Store | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.project.dorumdorum.domain.chat.application.dto.response; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| public record ChatReadReceiptResponse( | ||
| String chatRoomNo, | ||
| String readerUserNo, | ||
| LocalDateTime readAt | ||
| ) {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,18 +19,21 @@ | |
| import com.project.dorumdorum.domain.user.domain.entity.Role; | ||
| import com.project.dorumdorum.domain.user.domain.entity.User; | ||
| import com.project.dorumdorum.domain.user.domain.service.UserService; | ||
| import com.project.dorumdorum.testsupport.TestcontainersSupport; | ||
| import com.google.firebase.FirebaseApp; | ||
| import com.google.firebase.messaging.FirebaseMessaging; | ||
| import org.junit.jupiter.api.Assumptions; | ||
| import org.junit.jupiter.api.AfterEach; | ||
| import org.junit.jupiter.api.BeforeAll; | ||
| import org.junit.jupiter.api.BeforeEach; | ||
| import org.junit.jupiter.api.DisplayName; | ||
| import org.junit.jupiter.api.Test; | ||
| import org.mockito.Mockito; | ||
| import org.springframework.messaging.simp.SimpMessagingTemplate; | ||
| import org.springframework.beans.factory.annotation.Autowired; | ||
| import org.springframework.boot.test.context.SpringBootTest; | ||
| import org.springframework.boot.test.mock.mockito.MockBean; | ||
| import org.springframework.boot.test.mock.mockito.SpyBean; | ||
| import org.springframework.test.context.bean.override.mockito.MockitoBean; | ||
| import org.springframework.test.context.bean.override.mockito.MockitoSpyBean; | ||
| import org.springframework.test.context.ActiveProfiles; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
@@ -64,9 +67,17 @@ | |
| @DisplayName("채팅 트랜잭션 원자성 통합 테스트 (BEFORE_COMMIT)") | ||
| class ChatTransactionAtomicityIntegrationTest { | ||
|
|
||
| @BeforeAll | ||
| static void requireDocker() { | ||
| Assumptions.assumeTrue( | ||
| TestcontainersSupport.requireDockerOrSkip("ChatTransactionAtomicityIntegrationTest"), | ||
| "Docker is required for ChatTransactionAtomicityIntegrationTest" | ||
| ); | ||
| } | ||
|
Comment on lines
+70
to
+76
|
||
|
|
||
| // ─── Firebase 목 (FileInputStream 오류 방지 — 테스트에서 FCM 사용 안 함) ── | ||
| @MockBean @SuppressWarnings("unused") private FirebaseApp firebaseApp; | ||
| @MockBean @SuppressWarnings("unused") private FirebaseMessaging firebaseMessaging; | ||
| @MockitoBean @SuppressWarnings("unused") private FirebaseApp firebaseApp; | ||
| @MockitoBean @SuppressWarnings("unused") private FirebaseMessaging firebaseMessaging; | ||
|
|
||
| // ─── UseCase ────────────────────────────────────────────────────────────── | ||
| @Autowired private KickRoommateUseCase kickRoommateUseCase; | ||
|
|
@@ -78,12 +89,12 @@ class ChatTransactionAtomicityIntegrationTest { | |
| @Autowired private ChatRoomMemberRepository chatRoomMemberRepository; | ||
|
|
||
| // ─── External Services (Mocking to isolate behavior) ───────────────────── | ||
| @MockBean private SimpMessagingTemplate messagingTemplate; | ||
| @MockitoBean private SimpMessagingTemplate messagingTemplate; | ||
|
|
||
| // ─── SpyBean (특정 메서드만 실패 강제 또는 외부 의존 우회) ───────────── | ||
| @SpyBean private ChatRoomMemberService chatRoomMemberService; | ||
| @SpyBean private UserService userService; | ||
| @SpyBean private ChatMessageService chatMessageService; | ||
| @MockitoSpyBean private ChatRoomMemberService chatRoomMemberService; | ||
| @MockitoSpyBean private UserService userService; | ||
| @MockitoSpyBean private ChatMessageService chatMessageService; | ||
|
|
||
| // ─── 테스트 픽스처 ──────────────────────────────────────────────────────── | ||
| private Room room; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SpringBootTest는 JUnit@BeforeAll보다 먼저 Spring 컨텍스트를 초기화하므로, 이Assumptions.assumeTrue(...)로는 Docker 없는 환경에서 Testcontainers datasource 초기화 실패를 방지할 수 없습니다. Docker 필요 여부를 컨텍스트 로딩 이전에 평가되는 방식(예: JUnit5ExecutionCondition확장/조건부 실행 애너테이션, 또는@Testcontainers(disabledWithoutDocker = true)등)으로 전환해 테스트 클래스 자체가 스킵되도록 해주세요.