Skip to content

Commit

Permalink
Formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
probation-integration-bot[bot] authored Dec 11, 2024
1 parent 58ae57e commit cf5d89d
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -82,7 +81,6 @@ class ReferralControllerIntegrationTest {
.andReturn().response.contentAsJson<ReferralDetail>()

assertThat(res, equalTo(detail))

}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ class DataLoader(
createPersonWithKeyDates(PersonGenerator.PERSON_WITH_KEYDATES_BY_CRN, "48340A", keyDateTypes)
}

private fun createPersonWithKeyDates(personRef: Person, bookingRef: String, keyDateTypes: List<ReferenceData>): Custody {
private fun createPersonWithKeyDates(
personRef: Person,
bookingRef: String,
keyDateTypes: List<ReferenceData>
): Custody {
val person = personRepository.save(personRef)
val event = eventRepository.save(generateEvent(person, "1"))
orderManagerRepository.save(generateOrderManager(event))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class CustodyDateUpdateService(
existing.changeDate(date)
} else {
val kdt = referenceDataRepository.findKeyDateType(code)
KeyDate( this, kdt, date)
KeyDate(this, kdt, date)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ interface OffenderManagerRepository : JpaRepository<OffenderManager, Long> {

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<OffenderManager>
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class DataLoader(
)
)
}

fun EntityManager.saveAll(vararg any: Any) = any.forEach { merge(it) }

private fun createAppointments(person: Person) {
Expand Down

0 comments on commit cf5d89d

Please sign in to comment.