Skip to content

Commit

Permalink
PI-2249 use handover logic (#4027)
Browse files Browse the repository at this point in the history
  • Loading branch information
achimber-moj authored Jul 11, 2024
1 parent 66e3446 commit 5f8ffc4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ class PomCaseMessageHandler(
try {
when (val message = notification.message) {
is HmppsDomainEvent -> when (notification.eventType) {
"offender-management.handover.changed" -> handoverDatesChanged.process(
"offender-management.handover.changed", BULK_HANDOVER_DATE_UPDATE -> handoverDatesChanged.process(
HandoverMessage(
message.personReference,
message.detailUrl
)
)

"offender-management.allocation.changed", BULK_HANDOVER_DATE_UPDATE -> pomAllocated.process(message)
"offender-management.allocation.changed" -> pomAllocated.process(message)
else -> throw NotImplementedError("Unhandled message type received: ${notification.eventType}")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ internal class HandlerTest {

@Test
fun `handles internal event type`() {
doNothing().whenever(pomAllocated).process(any<HmppsDomainEvent>())
doNothing().whenever(handoverDatesChanged).process(any<HandoverMessage>())
handler.handle(
Notification(
message = HmppsDomainEvent(
Expand All @@ -77,7 +77,7 @@ internal class HandlerTest {
)
)

verify(pomAllocated, times(1)).process(any<HmppsDomainEvent>())
verifyNoMoreInteractions(pomAllocated)
verify(handoverDatesChanged, times(1)).process(any<HandoverMessage>())
verifyNoMoreInteractions(handoverDatesChanged)
}
}

0 comments on commit 5f8ffc4

Please sign in to comment.