File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
src/test/java/com/somemore/interestcenter/converter Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .somemore .interestcenter .converter ;
2+
3+ import com .somemore .IntegrationTestSupport ;
4+ import com .somemore .global .common .event .DomainEventSubType ;
5+ import com .somemore .global .common .event .ServerEventType ;
6+ import com .somemore .recruitboard .event .CreateRecruitBoardEvent ;
7+ import org .junit .jupiter .api .DisplayName ;
8+ import org .junit .jupiter .api .Test ;
9+ import org .springframework .beans .factory .annotation .Autowired ;
10+
11+ import java .util .UUID ;
12+
13+ import static org .assertj .core .api .Assertions .assertThat ;
14+
15+ class CreateRecruitBoardMessageConverterTest extends IntegrationTestSupport {
16+
17+ @ Autowired
18+ private CreateRecruitBoardMessageConverter createRecruitBoardMessageConverter ;
19+
20+ @ Test
21+ @ DisplayName ("CREATE_RECRUIT_BOARD 메시지를 변환하면 CreateRecruitBoardEvent 객체를 반환한다" )
22+ void testVolunteerReviewRequestConversion () {
23+ // given
24+ String message = """
25+ {
26+ "type": "DOMAIN_EVENT",
27+ "subType": "CREATE_RECRUIT_BOARD",
28+ "centerId": "123e4567-e89b-12d3-a456-426614174001",
29+ "recruitBoardId": 456,
30+ "createdAt": "2024-12-05T10:00:00"
31+ }
32+ """ ;
33+
34+ // when
35+ CreateRecruitBoardEvent event = createRecruitBoardMessageConverter .from (message );
36+
37+ // then
38+ assertThat (event .getCenterId ()).isEqualTo (UUID .fromString ("123e4567-e89b-12d3-a456-426614174001" ));
39+ assertThat (event .getRecruitBoardId ()).isEqualTo (456 );
40+ assertThat (event .getType ()).isEqualTo (ServerEventType .DOMAIN_EVENT );
41+ assertThat (event .getSubType ()).isEqualTo (DomainEventSubType .CREATE_RECRUIT_BOARD );
42+ }
43+
44+ }
You can’t perform that action at this time.
0 commit comments