From 4a36d35168f6dbaceb06a8d17983a74a1565292c Mon Sep 17 00:00:00 2001 From: Anthony Britton Date: Wed, 20 Sep 2023 16:25:08 +0100 Subject: [PATCH] PI-1473 add enhancement ability for domain events --- .../justice/digital/hmpps/service/enhancement/Enhancement.kt | 2 +- .../digital/hmpps/service/enhancement/NotificationEnhancer.kt | 2 +- .../enhancement/ProbationCaseEngagementCreatedEnhancement.kt | 2 +- .../gov/justice/digital/hmpps/service/DomainEventServiceTest.kt | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/projects/domain-events-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/enhancement/Enhancement.kt b/projects/domain-events-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/enhancement/Enhancement.kt index 9f07cc3d3d..0a3934a8f3 100644 --- a/projects/domain-events-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/enhancement/Enhancement.kt +++ b/projects/domain-events-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/enhancement/Enhancement.kt @@ -24,4 +24,4 @@ sealed interface EnhancedEventType { fun of(value: String): EnhancedEventType = types[value] ?: NoEnhancement(value) } -} \ No newline at end of file +} diff --git a/projects/domain-events-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/enhancement/NotificationEnhancer.kt b/projects/domain-events-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/enhancement/NotificationEnhancer.kt index d7385dc75d..68e81b4a99 100644 --- a/projects/domain-events-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/enhancement/NotificationEnhancer.kt +++ b/projects/domain-events-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/enhancement/NotificationEnhancer.kt @@ -16,4 +16,4 @@ class NotificationEnhancer(enhancements: List) { override val eventType = enhancedEventType override fun enhance(notification: Notification) = notification } -} \ No newline at end of file +} diff --git a/projects/domain-events-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/enhancement/ProbationCaseEngagementCreatedEnhancement.kt b/projects/domain-events-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/enhancement/ProbationCaseEngagementCreatedEnhancement.kt index 70435a0d5b..60f420df07 100644 --- a/projects/domain-events-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/enhancement/ProbationCaseEngagementCreatedEnhancement.kt +++ b/projects/domain-events-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/enhancement/ProbationCaseEngagementCreatedEnhancement.kt @@ -19,4 +19,4 @@ class ProbationCaseEngagementCreatedEnhancement( ) ) } -} \ No newline at end of file +} diff --git a/projects/domain-events-and-delius/src/test/kotlin/uk/gov/justice/digital/hmpps/service/DomainEventServiceTest.kt b/projects/domain-events-and-delius/src/test/kotlin/uk/gov/justice/digital/hmpps/service/DomainEventServiceTest.kt index b21ab7f74e..8ec9db32bf 100644 --- a/projects/domain-events-and-delius/src/test/kotlin/uk/gov/justice/digital/hmpps/service/DomainEventServiceTest.kt +++ b/projects/domain-events-and-delius/src/test/kotlin/uk/gov/justice/digital/hmpps/service/DomainEventServiceTest.kt @@ -46,6 +46,7 @@ class DomainEventServiceTest { notificationPublisher = notificationPublisher, notificationEnhancer = notificationEnhancer ) + whenever(notificationEnhancer.enhance(any())).thenAnswer { it.getArgument(0) } } @Test