diff --git a/src/main/java/com/somemore/volunteerapply/event/VolunteerApplyStatusChangeEvent.java b/src/main/java/com/somemore/volunteerapply/event/VolunteerApplyStatusChangeEvent.java index bbfc62569..6d5d2995e 100644 --- a/src/main/java/com/somemore/volunteerapply/event/VolunteerApplyStatusChangeEvent.java +++ b/src/main/java/com/somemore/volunteerapply/event/VolunteerApplyStatusChangeEvent.java @@ -5,7 +5,9 @@ import com.somemore.global.common.event.ServerEvent; import com.somemore.global.common.event.ServerEventType; import com.somemore.notification.domain.NotificationSubType; +import com.somemore.recruitboard.domain.RecruitBoard; import com.somemore.volunteerapply.domain.ApplyStatus; +import com.somemore.volunteerapply.domain.VolunteerApply; import lombok.Getter; import lombok.experimental.SuperBuilder; @@ -40,4 +42,18 @@ public VolunteerApplyStatusChangeEvent( this.oldStatus = oldStatus; this.newStatus = newStatus; } + + public static VolunteerApplyStatusChangeEvent from(VolunteerApply apply, RecruitBoard recruitBoard, ApplyStatus oldStatus) { + + return VolunteerApplyStatusChangeEvent.builder() + .type(ServerEventType.NOTIFICATION) + .subType(NotificationSubType.VOLUNTEER_APPLY_STATUS_CHANGE) + .volunteerId(apply.getVolunteerId()) + .volunteerApplyId(apply.getId()) + .centerId(recruitBoard.getCenterId()) + .recruitBoardId(recruitBoard.getId()) + .oldStatus(oldStatus) + .newStatus(apply.getStatus()) + .build(); + } } diff --git a/src/main/java/com/somemore/volunteerapply/service/RejectVolunteerApplyService.java b/src/main/java/com/somemore/volunteerapply/service/RejectVolunteerApplyService.java deleted file mode 100644 index d8a0da337..000000000 --- a/src/main/java/com/somemore/volunteerapply/service/RejectVolunteerApplyService.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.somemore.volunteerapply.service; - -import static com.somemore.global.exception.ExceptionMessage.NOT_EXISTS_VOLUNTEER_APPLY; -import static com.somemore.global.exception.ExceptionMessage.RECRUIT_BOARD_ALREADY_COMPLETED; -import static com.somemore.global.exception.ExceptionMessage.UNAUTHORIZED_RECRUIT_BOARD; -import static com.somemore.volunteerapply.domain.ApplyStatus.REJECTED; - -import com.somemore.global.exception.BadRequestException; -import com.somemore.recruitboard.domain.RecruitBoard; -import com.somemore.recruitboard.usecase.query.RecruitBoardQueryUseCase; -import com.somemore.volunteerapply.domain.VolunteerApply; -import com.somemore.volunteerapply.repository.VolunteerApplyRepository; -import com.somemore.volunteerapply.usecase.RejectVolunteerApplyUseCase; -import java.util.UUID; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -@RequiredArgsConstructor -@Transactional -@Service -public class RejectVolunteerApplyService implements RejectVolunteerApplyUseCase { - - private final VolunteerApplyRepository volunteerApplyRepository; - private final RecruitBoardQueryUseCase recruitBoardQueryUseCase; - - @Override - public void reject(Long id, UUID centerId) { - VolunteerApply apply = getApply(id); - RecruitBoard recruitBoard = recruitBoardQueryUseCase.getById(apply.getRecruitBoardId()); - - validateWriter(recruitBoard, centerId); - validateBoardStatus(recruitBoard); - - apply.changeStatus(REJECTED); - volunteerApplyRepository.save(apply); - } - - private VolunteerApply getApply(Long id) { - return volunteerApplyRepository.findById(id).orElseThrow( - () -> new BadRequestException(NOT_EXISTS_VOLUNTEER_APPLY) - ); - } - - private void validateWriter(RecruitBoard recruitBoard, UUID centerId) { - if (recruitBoard.isWriter(centerId)) { - return; - } - throw new BadRequestException(UNAUTHORIZED_RECRUIT_BOARD); - } - - private void validateBoardStatus(RecruitBoard recruitBoard) { - if (recruitBoard.isCompleted()) { - throw new BadRequestException(RECRUIT_BOARD_ALREADY_COMPLETED); - } - } - -} diff --git a/src/main/java/com/somemore/volunteerapply/service/ApproveVolunteerApplyService.java b/src/main/java/com/somemore/volunteerapply/service/VolunteerApplyStatusChangeService.java similarity index 73% rename from src/main/java/com/somemore/volunteerapply/service/ApproveVolunteerApplyService.java rename to src/main/java/com/somemore/volunteerapply/service/VolunteerApplyStatusChangeService.java index ba350d39b..0c0a2be86 100644 --- a/src/main/java/com/somemore/volunteerapply/service/ApproveVolunteerApplyService.java +++ b/src/main/java/com/somemore/volunteerapply/service/VolunteerApplyStatusChangeService.java @@ -1,9 +1,7 @@ package com.somemore.volunteerapply.service; import com.somemore.global.common.event.ServerEventPublisher; -import com.somemore.global.common.event.ServerEventType; import com.somemore.global.exception.BadRequestException; -import com.somemore.notification.domain.NotificationSubType; import com.somemore.recruitboard.domain.RecruitBoard; import com.somemore.recruitboard.usecase.query.RecruitBoardQueryUseCase; import com.somemore.volunteerapply.domain.ApplyStatus; @@ -11,6 +9,7 @@ import com.somemore.volunteerapply.event.VolunteerApplyStatusChangeEvent; import com.somemore.volunteerapply.repository.VolunteerApplyRepository; import com.somemore.volunteerapply.usecase.ApproveVolunteerApplyUseCase; +import com.somemore.volunteerapply.usecase.RejectVolunteerApplyUseCase; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -21,11 +20,12 @@ import static com.somemore.global.exception.ExceptionMessage.RECRUIT_BOARD_ALREADY_COMPLETED; import static com.somemore.global.exception.ExceptionMessage.UNAUTHORIZED_RECRUIT_BOARD; import static com.somemore.volunteerapply.domain.ApplyStatus.APPROVED; +import static com.somemore.volunteerapply.domain.ApplyStatus.REJECTED; @RequiredArgsConstructor @Transactional @Service -public class ApproveVolunteerApplyService implements ApproveVolunteerApplyUseCase { +public class VolunteerApplyStatusChangeService implements ApproveVolunteerApplyUseCase, RejectVolunteerApplyUseCase { private final VolunteerApplyRepository volunteerApplyRepository; private final RecruitBoardQueryUseCase recruitBoardQueryUseCase; @@ -33,6 +33,15 @@ public class ApproveVolunteerApplyService implements ApproveVolunteerApplyUseCas @Override public void approve(Long id, UUID centerId) { + changeApplyStatus(id, centerId, APPROVED); + } + + @Override + public void reject(Long id, UUID centerId) { + changeApplyStatus(id, centerId, REJECTED); + } + + private void changeApplyStatus(Long id, UUID centerId, ApplyStatus newStatus) { VolunteerApply apply = getVolunteerApply(id); RecruitBoard recruitBoard = recruitBoardQueryUseCase.getById(apply.getRecruitBoardId()); @@ -40,7 +49,7 @@ public void approve(Long id, UUID centerId) { validateBoardStatus(recruitBoard); ApplyStatus oldStatus = apply.getStatus(); - apply.changeStatus(APPROVED); + apply.changeStatus(newStatus); volunteerApplyRepository.save(apply); publishVolunteerApplyStatusChangeEvent(apply, recruitBoard, oldStatus); @@ -65,18 +74,12 @@ private void validateBoardStatus(RecruitBoard recruitBoard) { } } - private void publishVolunteerApplyStatusChangeEvent(VolunteerApply apply, RecruitBoard recruitBoard, ApplyStatus oldStatus) { - VolunteerApplyStatusChangeEvent event = VolunteerApplyStatusChangeEvent.builder() - .type(ServerEventType.NOTIFICATION) - .subType(NotificationSubType.VOLUNTEER_APPLY_STATUS_CHANGE) - .volunteerId(apply.getVolunteerId()) - .volunteerApplyId(apply.getId()) - .centerId(recruitBoard.getCenterId()) - .recruitBoardId(recruitBoard.getId()) - .oldStatus(oldStatus) - .newStatus(apply.getStatus()) - .build(); - - serverEventPublisher.publish(event); + private void publishVolunteerApplyStatusChangeEvent(VolunteerApply apply, + RecruitBoard recruitBoard, + ApplyStatus oldStatus) { + if (apply.getStatus() == oldStatus) { + return; + } + serverEventPublisher.publish(VolunteerApplyStatusChangeEvent.from(apply, recruitBoard, oldStatus)); } -} +} \ No newline at end of file diff --git a/src/test/java/com/somemore/volunteerapply/service/ApplyVolunteerApplyServiceTest.java b/src/test/java/com/somemore/volunteerapply/service/ApplyVolunteerApplyStatusChangeServiceTest.java similarity index 97% rename from src/test/java/com/somemore/volunteerapply/service/ApplyVolunteerApplyServiceTest.java rename to src/test/java/com/somemore/volunteerapply/service/ApplyVolunteerApplyStatusChangeServiceTest.java index 1b7099008..6a082e10a 100644 --- a/src/test/java/com/somemore/volunteerapply/service/ApplyVolunteerApplyServiceTest.java +++ b/src/test/java/com/somemore/volunteerapply/service/ApplyVolunteerApplyStatusChangeServiceTest.java @@ -22,7 +22,7 @@ import org.springframework.transaction.annotation.Transactional; @Transactional -class ApplyVolunteerApplyServiceTest extends IntegrationTestSupport { +class ApplyVolunteerApplyStatusChangeServiceTest extends IntegrationTestSupport { @Autowired private ApplyVolunteerApplyService volunteerApplyCommandService; diff --git a/src/test/java/com/somemore/volunteerapply/service/ApproveVolunteerApplyServiceTest.java b/src/test/java/com/somemore/volunteerapply/service/ApproveVolunteerApplyStatusChangeServiceTest.java similarity index 54% rename from src/test/java/com/somemore/volunteerapply/service/ApproveVolunteerApplyServiceTest.java rename to src/test/java/com/somemore/volunteerapply/service/ApproveVolunteerApplyStatusChangeServiceTest.java index 8835c5e87..6c5b541ff 100644 --- a/src/test/java/com/somemore/volunteerapply/service/ApproveVolunteerApplyServiceTest.java +++ b/src/test/java/com/somemore/volunteerapply/service/ApproveVolunteerApplyStatusChangeServiceTest.java @@ -1,32 +1,42 @@ package com.somemore.volunteerapply.service; -import static com.somemore.common.fixture.RecruitBoardFixture.createCompletedRecruitBoard; -import static com.somemore.common.fixture.RecruitBoardFixture.createRecruitBoard; -import static com.somemore.global.exception.ExceptionMessage.UNAUTHORIZED_RECRUIT_BOARD; -import static com.somemore.recruitboard.domain.VolunteerCategory.OTHER; -import static com.somemore.volunteerapply.domain.ApplyStatus.APPROVED; -import static com.somemore.volunteerapply.domain.ApplyStatus.WAITING; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; - import com.somemore.IntegrationTestSupport; +import com.somemore.global.common.event.ServerEventPublisher; import com.somemore.global.exception.BadRequestException; import com.somemore.global.exception.ExceptionMessage; import com.somemore.recruitboard.domain.RecruitBoard; import com.somemore.recruitboard.repository.RecruitBoardRepository; +import com.somemore.recruitboard.usecase.query.RecruitBoardQueryUseCase; import com.somemore.volunteerapply.domain.VolunteerApply; +import com.somemore.volunteerapply.event.VolunteerApplyStatusChangeEvent; import com.somemore.volunteerapply.repository.VolunteerApplyRepository; -import java.util.UUID; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; +import java.util.UUID; + +import static com.somemore.common.fixture.RecruitBoardFixture.createCompletedRecruitBoard; +import static com.somemore.common.fixture.RecruitBoardFixture.createRecruitBoard; +import static com.somemore.global.exception.ExceptionMessage.UNAUTHORIZED_RECRUIT_BOARD; +import static com.somemore.recruitboard.domain.VolunteerCategory.OTHER; +import static com.somemore.volunteerapply.domain.ApplyStatus.APPROVED; +import static com.somemore.volunteerapply.domain.ApplyStatus.WAITING; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + @Transactional -class ApproveVolunteerApplyServiceTest extends IntegrationTestSupport { +class ApproveVolunteerApplyStatusChangeServiceTest extends IntegrationTestSupport { - @Autowired - private ApproveVolunteerApplyService approveVolunteerApplyService; + private VolunteerApplyStatusChangeService volunteerApplyStatusChangeService; @Autowired private VolunteerApplyRepository volunteerApplyRepository; @@ -34,6 +44,22 @@ class ApproveVolunteerApplyServiceTest extends IntegrationTestSupport { @Autowired private RecruitBoardRepository recruitBoardRepository; + @Autowired + private RecruitBoardQueryUseCase recruitBoardQueryUseCase; + + + ServerEventPublisher serverEventPublisher; + + @BeforeEach + void setUp() { + serverEventPublisher = mock(ServerEventPublisher.class); + volunteerApplyStatusChangeService = new VolunteerApplyStatusChangeService( + volunteerApplyRepository, + recruitBoardQueryUseCase, + serverEventPublisher + ); + } + @DisplayName("봉사 지원을 승인할 수 있다.") @Test void approve() { @@ -47,7 +73,7 @@ void approve() { volunteerApplyRepository.save(apply); // when - approveVolunteerApplyService.approve(apply.getId(), centerId); + volunteerApplyStatusChangeService.approve(apply.getId(), centerId); // then VolunteerApply approve = volunteerApplyRepository.findById(apply.getId()).orElseThrow(); @@ -71,7 +97,7 @@ void approveWithWrongCenter() { // when // then assertThatThrownBy( - () -> approveVolunteerApplyService.approve(id, wrongCenterId) + () -> volunteerApplyStatusChangeService.approve(id, wrongCenterId) ).isInstanceOf(BadRequestException.class) .hasMessage(UNAUTHORIZED_RECRUIT_BOARD.getMessage()); } @@ -91,11 +117,57 @@ void approveWithAlreadyCompletedRecruit() { // when // then assertThatThrownBy( - () -> approveVolunteerApplyService.approve(id, centerId) + () -> volunteerApplyStatusChangeService.approve(id, centerId) ).isInstanceOf(BadRequestException.class) .hasMessage(ExceptionMessage.RECRUIT_BOARD_ALREADY_COMPLETED.getMessage()); } + @DisplayName("지원 상태가 변경되지 않은 경우 이벤트 퍼블리셔가 호출되지 않는다.") + @Test + void approveWithSameStatusDoesNotPublishEvent() { + // given + UUID centerId = UUID.randomUUID(); + + RecruitBoard board = createRecruitBoard(centerId); + recruitBoardRepository.save(board); + + VolunteerApply apply = createApply(board.getId()); + apply.changeStatus(APPROVED); + volunteerApplyRepository.save(apply); + + // when + volunteerApplyStatusChangeService.approve(apply.getId(), centerId); + + // then + verify(serverEventPublisher, never()).publish(any()); + VolunteerApply approvedApply = volunteerApplyRepository.findById(apply.getId()).orElseThrow(); + assertThat(approvedApply.getStatus()).isEqualTo(APPROVED); + } + + @DisplayName("지원 상태가 변경된 경우 이벤트 퍼블리셔가 호출된다.") + @Test + void approveWithDifferentStatusPublishesEvent() { + // given + UUID centerId = UUID.randomUUID(); + + RecruitBoard board = createRecruitBoard(centerId); + recruitBoardRepository.save(board); + + VolunteerApply apply = createApply(board.getId()); + volunteerApplyRepository.save(apply); + + // when + volunteerApplyStatusChangeService.approve(apply.getId(), centerId); + + // then + ArgumentCaptor eventCaptor = ArgumentCaptor.forClass(VolunteerApplyStatusChangeEvent.class); + verify(serverEventPublisher, times(1)).publish(eventCaptor.capture()); + + VolunteerApplyStatusChangeEvent capturedEvent = eventCaptor.getValue(); + assertThat(capturedEvent).isNotNull(); + assertThat(capturedEvent.getVolunteerApplyId()).isEqualTo(apply.getId()); + } + private VolunteerApply createApply(Long recruitBoardId) { return VolunteerApply.builder() .volunteerId(UUID.randomUUID()) @@ -104,5 +176,4 @@ private VolunteerApply createApply(Long recruitBoardId) { .attended(false) .build(); } - } diff --git a/src/test/java/com/somemore/volunteerapply/service/RejectVolunteerApplyServiceTest.java b/src/test/java/com/somemore/volunteerapply/service/RejectVolunteerApplyStatusChangeServiceTest.java similarity index 54% rename from src/test/java/com/somemore/volunteerapply/service/RejectVolunteerApplyServiceTest.java rename to src/test/java/com/somemore/volunteerapply/service/RejectVolunteerApplyStatusChangeServiceTest.java index 665dc276e..c929a0acf 100644 --- a/src/test/java/com/somemore/volunteerapply/service/RejectVolunteerApplyServiceTest.java +++ b/src/test/java/com/somemore/volunteerapply/service/RejectVolunteerApplyStatusChangeServiceTest.java @@ -1,32 +1,42 @@ package com.somemore.volunteerapply.service; -import static com.somemore.common.fixture.RecruitBoardFixture.createCompletedRecruitBoard; -import static com.somemore.common.fixture.RecruitBoardFixture.createRecruitBoard; -import static com.somemore.global.exception.ExceptionMessage.UNAUTHORIZED_RECRUIT_BOARD; -import static com.somemore.recruitboard.domain.VolunteerCategory.OTHER; -import static com.somemore.volunteerapply.domain.ApplyStatus.REJECTED; -import static com.somemore.volunteerapply.domain.ApplyStatus.WAITING; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; - import com.somemore.IntegrationTestSupport; +import com.somemore.global.common.event.ServerEventPublisher; import com.somemore.global.exception.BadRequestException; import com.somemore.global.exception.ExceptionMessage; import com.somemore.recruitboard.domain.RecruitBoard; import com.somemore.recruitboard.repository.RecruitBoardRepository; +import com.somemore.recruitboard.usecase.query.RecruitBoardQueryUseCase; import com.somemore.volunteerapply.domain.VolunteerApply; +import com.somemore.volunteerapply.event.VolunteerApplyStatusChangeEvent; import com.somemore.volunteerapply.repository.VolunteerApplyRepository; -import java.util.UUID; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; +import java.util.UUID; + +import static com.somemore.common.fixture.RecruitBoardFixture.createCompletedRecruitBoard; +import static com.somemore.common.fixture.RecruitBoardFixture.createRecruitBoard; +import static com.somemore.global.exception.ExceptionMessage.UNAUTHORIZED_RECRUIT_BOARD; +import static com.somemore.recruitboard.domain.VolunteerCategory.OTHER; +import static com.somemore.volunteerapply.domain.ApplyStatus.REJECTED; +import static com.somemore.volunteerapply.domain.ApplyStatus.WAITING; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + @Transactional -class RejectVolunteerApplyServiceTest extends IntegrationTestSupport { +class RejectVolunteerApplyStatusChangeServiceTest extends IntegrationTestSupport { - @Autowired - private RejectVolunteerApplyService rejectVolunteerApplyService; + private VolunteerApplyStatusChangeService volunteerApplyStatusChangeService; @Autowired private VolunteerApplyRepository volunteerApplyRepository; @@ -34,6 +44,22 @@ class RejectVolunteerApplyServiceTest extends IntegrationTestSupport { @Autowired private RecruitBoardRepository recruitBoardRepository; + @Autowired + private RecruitBoardQueryUseCase recruitBoardQueryUseCase; + + + ServerEventPublisher serverEventPublisher; + + @BeforeEach + void setUp() { + serverEventPublisher = mock(ServerEventPublisher.class); + volunteerApplyStatusChangeService = new VolunteerApplyStatusChangeService( + volunteerApplyRepository, + recruitBoardQueryUseCase, + serverEventPublisher + ); + } + @DisplayName("봉사 지원을 거절할 수 있다.") @Test void reject() { @@ -47,7 +73,7 @@ void reject() { volunteerApplyRepository.save(apply); // when - rejectVolunteerApplyService.reject(apply.getId(), centerId); + volunteerApplyStatusChangeService.reject(apply.getId(), centerId); // then VolunteerApply approve = volunteerApplyRepository.findById(apply.getId()).orElseThrow(); @@ -71,7 +97,7 @@ void rejectWithWrongCenter() { // when // then assertThatThrownBy( - () -> rejectVolunteerApplyService.reject(id, wrongCenterId) + () -> volunteerApplyStatusChangeService.reject(id, wrongCenterId) ).isInstanceOf(BadRequestException.class) .hasMessage(UNAUTHORIZED_RECRUIT_BOARD.getMessage()); } @@ -91,11 +117,57 @@ void rejectWithAlreadyCompletedRecruit() { // when // then assertThatThrownBy( - () -> rejectVolunteerApplyService.reject(id, centerId) + () -> volunteerApplyStatusChangeService.reject(id, centerId) ).isInstanceOf(BadRequestException.class) .hasMessage(ExceptionMessage.RECRUIT_BOARD_ALREADY_COMPLETED.getMessage()); } + @DisplayName("지원 상태가 변경되지 않은 경우 이벤트 퍼블리셔가 호출되지 않는다.") + @Test + void approveWithSameStatusDoesNotPublishEvent() { + // given + UUID centerId = UUID.randomUUID(); + + RecruitBoard board = createRecruitBoard(centerId); + recruitBoardRepository.save(board); + + VolunteerApply apply = createApply(board.getId()); + apply.changeStatus(REJECTED); + volunteerApplyRepository.save(apply); + + // when + volunteerApplyStatusChangeService.reject(apply.getId(), centerId); + + // then + verify(serverEventPublisher, never()).publish(any()); + VolunteerApply approvedApply = volunteerApplyRepository.findById(apply.getId()).orElseThrow(); + assertThat(approvedApply.getStatus()).isEqualTo(REJECTED); + } + + @DisplayName("지원 상태가 변경된 경우 이벤트 퍼블리셔가 호출된다.") + @Test + void approveWithDifferentStatusPublishesEvent() { + // given + UUID centerId = UUID.randomUUID(); + + RecruitBoard board = createRecruitBoard(centerId); + recruitBoardRepository.save(board); + + VolunteerApply apply = createApply(board.getId()); + volunteerApplyRepository.save(apply); + + // when + volunteerApplyStatusChangeService.reject(apply.getId(), centerId); + + // then + ArgumentCaptor eventCaptor = ArgumentCaptor.forClass(VolunteerApplyStatusChangeEvent.class); + verify(serverEventPublisher, times(1)).publish(eventCaptor.capture()); + + VolunteerApplyStatusChangeEvent capturedEvent = eventCaptor.getValue(); + assertThat(capturedEvent).isNotNull(); + assertThat(capturedEvent.getVolunteerApplyId()).isEqualTo(apply.getId()); + } + private VolunteerApply createApply(Long recruitBoardId) { return VolunteerApply.builder() .volunteerId(UUID.randomUUID())