diff --git a/projects/manage-supervision-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/SentenceIntegrationTest.kt b/projects/manage-supervision-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/SentenceIntegrationTest.kt index c7590cfef6..950c4a9f47 100644 --- a/projects/manage-supervision-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/SentenceIntegrationTest.kt +++ b/projects/manage-supervision-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/SentenceIntegrationTest.kt @@ -153,8 +153,9 @@ class SentenceIntegrationTest { LocalDate.now(), listOf( LicenceConditionNote( - note = "He shall not contact or associate with Peter Jones without the prior approval of the supervising officer;", - hasNotesBeenTruncated = false) + note = "He shall not contact or associate with Peter Jones without the prior approval of the supervising officer;", + hasNotesBeenTruncated = false + ) ) ) ) diff --git a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/SentenceService.kt b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/SentenceService.kt index 4312298a29..8a2f21666f 100644 --- a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/SentenceService.kt +++ b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/service/SentenceService.kt @@ -91,10 +91,11 @@ class SentenceService( notes?.let { val splitParam = "---------------------------------------------------------" + System.lineSeparator() - return notes.split(splitParam).map { - note -> - val addedBy = Regex("^Comment added by .+? on \\d{2}\\/\\d{2}\\/\\d{4} at \\d{2}:\\d{2}" - + System.lineSeparator()).find(note)?.value + return notes.split(splitParam).map { note -> + val addedBy = Regex( + "^Comment added by .+? on \\d{2}\\/\\d{2}\\/\\d{4} at \\d{2}:\\d{2}" + + System.lineSeparator() + ).find(note)?.value val noteText = addedBy?.let { note.removePrefix(addedBy) } ?: note