diff --git a/api/src/main/java/ca/bc/gov/educ/api/pen/services/service/events/EventHandlerService.java b/api/src/main/java/ca/bc/gov/educ/api/pen/services/service/events/EventHandlerService.java index bedbd06..7ea1257 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/pen/services/service/events/EventHandlerService.java +++ b/api/src/main/java/ca/bc/gov/educ/api/pen/services/service/events/EventHandlerService.java @@ -264,7 +264,7 @@ public byte[] handleGetMergeInDateRangeEvent(@NonNull final Event event) throws } } - final List mergeEntities = this.getStudentMergeService().findStudentMerges(createDateStart, createDateEnd, StudentMergeDirectionCodes.FROM.getCode()); + final List mergeEntities = this.getStudentMergeService().findStudentMerges(createDateStart, createDateEnd, StudentMergeDirectionCodes.TO.getCode()); final Event newEvent = Event.builder() .sagaId(event.getSagaId()) diff --git a/api/src/test/java/ca/bc/gov/educ/api/pen/services/service/events/EventHandlerDelegatorServiceTest.java b/api/src/test/java/ca/bc/gov/educ/api/pen/services/service/events/EventHandlerDelegatorServiceTest.java index 0df03b6..f9ddf0c 100644 --- a/api/src/test/java/ca/bc/gov/educ/api/pen/services/service/events/EventHandlerDelegatorServiceTest.java +++ b/api/src/test/java/ca/bc/gov/educ/api/pen/services/service/events/EventHandlerDelegatorServiceTest.java @@ -188,7 +188,7 @@ public void testHandleGetMergeEvent_givenStudentId_whenSuccessfullyProcessed_sho @Test public void testHandleGetMergeInDateRangeEvent_givenDateRange_whenSuccessfullyProcessed_shouldHaveEventOutcomeMERGE_FOUND() throws JsonProcessingException { final var studentMerge = mapper.toModel(createStudentMergePayload()); - studentMerge.setStudentMergeDirectionCode(StudentMergeDirectionCodes.FROM.getCode()); + studentMerge.setStudentMergeDirectionCode(StudentMergeDirectionCodes.TO.getCode()); studentMerge.setCreateDate(LocalDateTime.now().minusDays(5)); this.studentMergeRepository.save(studentMerge); diff --git a/api/src/test/java/ca/bc/gov/educ/api/pen/services/service/events/EventHandlerServiceTest.java b/api/src/test/java/ca/bc/gov/educ/api/pen/services/service/events/EventHandlerServiceTest.java index 846055f..22a449a 100644 --- a/api/src/test/java/ca/bc/gov/educ/api/pen/services/service/events/EventHandlerServiceTest.java +++ b/api/src/test/java/ca/bc/gov/educ/api/pen/services/service/events/EventHandlerServiceTest.java @@ -179,7 +179,7 @@ public void testHandleGetMergeEvent_givenStudentIdPayload_whenSuccessfullyProces @Test public void testHandleGetMergeInDateRangeEvent_givenDateRangePayload_whenSuccessfullyProcessed_shouldHaveEventOutcomeMERGE_FOUND() throws JsonProcessingException { final var studentMerge = this.createStudentMergePayload(); - studentMerge.setStudentMergeDirectionCode(StudentMergeDirectionCodes.FROM.getCode()); + studentMerge.setStudentMergeDirectionCode(StudentMergeDirectionCodes.TO.getCode()); var studentMergeEntity = mapper.toModel(studentMerge); studentMergeEntity.setCreateDate(LocalDateTime.now().minusDays(1)); this.studentMergeRepository.save(studentMergeEntity);