File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
src/test/java/com/somemore/notification/converter Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,31 @@ void testVolunteerApplyStatusChangeConversion() {
7676 assertThat (notification .getRelatedId ()).isEqualTo (456L );
7777 }
7878
79+ @ Test
80+ @ DisplayName ("INTEREST_CENTER_CREATE_RECRUIT_BOARD 메시지를 변환하면 Notification 객체를 반환한다. " )
81+ void testBuildInterestCenterCreateRecruitBoardNotification () {
82+ // given
83+ String message = """
84+ {
85+ "type": "NOTIFICATION",
86+ "subType": "INTEREST_CENTER_CREATE_RECRUIT_BOARD",
87+ "volunteerId": "123e4567-e89b-12d3-a456-426614174000",
88+ "centerId": "123e4567-e89b-12d3-a456-426614174001",
89+ "recruitBoardId": 456,
90+ "createdAt": "2024-12-05T10:00:00"
91+ }
92+ """ ;
93+
94+ // when
95+ Notification notification = notificationMessageConverter .from (message );
96+
97+ // then
98+ assertThat (notification .getReceiverId ()).isEqualTo (UUID .fromString ("123e4567-e89b-12d3-a456-426614174000" ));
99+ assertThat (notification .getTitle ()).isEqualTo ("관심 기관이 봉사 모집을 등록했습니다." );
100+ assertThat (notification .getType ()).isEqualTo (NotificationSubType .INTEREST_CENTER_CREATE_RECRUIT_BOARD );
101+ assertThat (notification .getRelatedId ()).isEqualTo (456L );
102+ }
103+
79104 @ Test
80105 @ DisplayName ("잘못된 JSON 메시지를 변환하면 IllegalStateException을 던진다" )
81106 void testInvalidJson () {
You can’t perform that action at this time.
0 commit comments