diff --git a/projects/approved-premises-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/MessagingIntegrationTest.kt b/projects/approved-premises-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/MessagingIntegrationTest.kt index e9bf51089..b65573586 100644 --- a/projects/approved-premises-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/MessagingIntegrationTest.kt +++ b/projects/approved-premises-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/MessagingIntegrationTest.kt @@ -150,7 +150,7 @@ internal class MessagingIntegrationTest { @Order(1) fun `booking made creates referral and contact`() { setUpTestSpecificData() - + // Given a booking-made event val event = prepEvent("booking-made", wireMockServer.port()) diff --git a/projects/approved-premises-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ReferralControllerIntegrationTest.kt b/projects/approved-premises-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ReferralControllerIntegrationTest.kt index 6436839e7..8b26b6557 100644 --- a/projects/approved-premises-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ReferralControllerIntegrationTest.kt +++ b/projects/approved-premises-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ReferralControllerIntegrationTest.kt @@ -38,7 +38,6 @@ class ReferralControllerIntegrationTest { @Autowired lateinit var residenceRepository: ResidenceRepository - @Test fun `existing referrals for a crn are returned successfully`() { referralRepository.save(ReferralGenerator.EXISTING_REFERRAL) @@ -82,7 +81,6 @@ class ReferralControllerIntegrationTest { .andReturn().response.contentAsJson() assertThat(res, equalTo(detail)) - } companion object { diff --git a/projects/custody-key-dates-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt b/projects/custody-key-dates-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt index 268427a6c..0727afcea 100644 --- a/projects/custody-key-dates-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt +++ b/projects/custody-key-dates-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt @@ -101,7 +101,11 @@ class DataLoader( createPersonWithKeyDates(PersonGenerator.PERSON_WITH_KEYDATES_BY_CRN, "48340A", keyDateTypes) } - private fun createPersonWithKeyDates(personRef: Person, bookingRef: String, keyDateTypes: List): Custody { + private fun createPersonWithKeyDates( + personRef: Person, + bookingRef: String, + keyDateTypes: List + ): Custody { val person = personRepository.save(personRef) val event = eventRepository.save(generateEvent(person, "1")) orderManagerRepository.save(generateOrderManager(event)) diff --git a/projects/custody-key-dates-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/custody/date/CustodyDateUpdateService.kt b/projects/custody-key-dates-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/custody/date/CustodyDateUpdateService.kt index e800428b9..10ae00456 100644 --- a/projects/custody-key-dates-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/custody/date/CustodyDateUpdateService.kt +++ b/projects/custody-key-dates-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/custody/date/CustodyDateUpdateService.kt @@ -94,7 +94,7 @@ class CustodyDateUpdateService( existing.changeDate(date) } else { val kdt = referenceDataRepository.findKeyDateType(code) - KeyDate( this, kdt, date) + KeyDate(this, kdt, date) } } diff --git a/projects/manage-pom-cases-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ApiIntegrationTest.kt b/projects/manage-pom-cases-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ApiIntegrationTest.kt index 4758b153b..39393660a 100644 --- a/projects/manage-pom-cases-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ApiIntegrationTest.kt +++ b/projects/manage-pom-cases-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/ApiIntegrationTest.kt @@ -66,7 +66,11 @@ internal class ApiIntegrationTest { @ParameterizedTest @MethodSource("caseIdentifiers") - fun `successful retrieval of a case record by crn or noms id`(identifier: String, person: Person, loadData: Boolean) { + fun `successful retrieval of a case record by crn or noms id`( + identifier: String, + person: Person, + loadData: Boolean + ) { if (loadData) { loadTestData() } diff --git a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/sentence/entity/SentenceRepository.kt b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/sentence/entity/SentenceRepository.kt index be13c9199..d15991e30 100644 --- a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/sentence/entity/SentenceRepository.kt +++ b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/sentence/entity/SentenceRepository.kt @@ -47,12 +47,14 @@ interface OffenderManagerRepository : JpaRepository { fun countOffenderManagersByPerson(person: Person): Long - @Query(""" + @Query( + """ SELECT om FROM OffenderManager om WHERE om.person.id = :id ORDER BY om.endDate - """) + """ + ) fun findOffenderManagersByPersonOrderByEndDateDesc(id: Long): List } diff --git a/projects/resettlement-passport-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt b/projects/resettlement-passport-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt index 899331c33..368b2d72f 100644 --- a/projects/resettlement-passport-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt +++ b/projects/resettlement-passport-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt @@ -100,6 +100,7 @@ class DataLoader( ) ) } + fun EntityManager.saveAll(vararg any: Any) = any.forEach { merge(it) } private fun createAppointments(person: Person) {