From 77d9aabf05ffa6abf10c9586f775db95318a347e Mon Sep 17 00:00:00 2001 From: achimber-moj <161360519+achimber-moj@users.noreply.github.com> Date: Thu, 18 Jul 2024 18:21:51 +0100 Subject: [PATCH] Feature/pi 2104 crn convictions conviction id pss requirements (#4051) * PI-2104 - add new api * PI-2104 - update tests * Formatting changes * PI-2104 - refactor model object --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../justice/digital/hmpps/data/DataLoader.kt | 20 +++-- .../hmpps/data/generator/SentenceGenerator.kt | 14 ++-- ...uirementsByCrnAndEventIdIntegrationTest.kt | 83 +++++++++++++++++++ .../hmpps/api/model/ProbationRecord.kt | 4 + .../api/model/conviction/PssRequirements.kt | 16 ++++ .../hmpps/api/resource/ConvictionResource.kt | 6 ++ .../event/conviction/entity/Requirement.kt | 25 +++++- .../delius/event/sentence/entity/Disposal.kt | 2 +- .../delius/service/RequirementService.kt | 44 ++++++++-- .../hmpps/service/RequirementServiceTest.kt | 55 ++++++++++++ 10 files changed, 247 insertions(+), 22 deletions(-) create mode 100644 projects/court-case-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/PssRequirementsByCrnAndEventIdIntegrationTest.kt create mode 100644 projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/conviction/PssRequirements.kt create mode 100644 projects/court-case-and-delius/src/test/kotlin/uk/gov/justice/digital/hmpps/service/RequirementServiceTest.kt diff --git a/projects/court-case-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt b/projects/court-case-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt index 9f87fe33ba..cf5f00ce59 100644 --- a/projects/court-case-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt +++ b/projects/court-case-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/DataLoader.kt @@ -9,10 +9,10 @@ import org.springframework.stereotype.Component import org.springframework.transaction.annotation.Transactional import uk.gov.justice.digital.hmpps.api.model.DocumentType import uk.gov.justice.digital.hmpps.data.generator.* +import uk.gov.justice.digital.hmpps.datetime.EuropeLondon import uk.gov.justice.digital.hmpps.user.AuditUserRepository import java.time.LocalDate import java.time.LocalTime -import java.time.ZoneId import java.time.ZonedDateTime @Component @@ -131,8 +131,8 @@ class DataLoader( noSentenceEvent, StaffGenerator.UNALLOCATED, CourtGenerator.PROBATION_AREA, - ZonedDateTime.of(LocalDate.now(), LocalTime.NOON, ZoneId.of("Europe/London")), - ZonedDateTime.of(LocalDate.now().minusDays(1), LocalTime.NOON, ZoneId.of("Europe/London")) + ZonedDateTime.of(LocalDate.now(), LocalTime.NOON, EuropeLondon), + ZonedDateTime.of(LocalDate.now().minusDays(1), LocalTime.NOON, EuropeLondon) ) val outcome = SentenceGenerator.OUTCOME val courtAppearance = SentenceGenerator.generateCourtAppearance(noSentenceEvent, outcome, ZonedDateTime.now()) @@ -146,8 +146,8 @@ class DataLoader( newEvent, StaffGenerator.UNALLOCATED, CourtGenerator.PROBATION_AREA, - ZonedDateTime.of(LocalDate.now().minusDays(1), LocalTime.NOON, ZoneId.of("Europe/London")), - ZonedDateTime.of(LocalDate.now().minusDays(3), LocalTime.NOON, ZoneId.of("Europe/London")) + ZonedDateTime.of(LocalDate.now().minusDays(1), LocalTime.NOON, EuropeLondon), + ZonedDateTime.of(LocalDate.now().minusDays(3), LocalTime.NOON, EuropeLondon) ) em.saveAll(newEvent, newSentence, newManager) @@ -159,7 +159,8 @@ class DataLoader( val additionalOffence = SentenceGenerator.ADDITIONAL_OFFENCE_DEFAULT val licenceCondition = SentenceGenerator.generateLicenseCondition(disposal = currentSentence) val breachNsi = SentenceGenerator.BREACH_NSIS - val pssRequirement = SentenceGenerator.generatePssRequirement(custody.id) + val activePssRequirement = SentenceGenerator.generatePssRequirement(custody.id, active = true) + val inactivePssRequirement = SentenceGenerator.generatePssRequirement(custody.id, active = false) val currentCourtAppearance = SentenceGenerator.COURT_APPEARANCE val currentCourtReport = SentenceGenerator.generateCourtReport(currentCourtAppearance) val reportManager = SentenceGenerator.generateCourtReportManager(currentCourtReport) @@ -203,7 +204,8 @@ class DataLoader( breachNsi, NsiManagerGenerator.ACTIVE, NsiManagerGenerator.INACTIVE, - pssRequirement, + activePssRequirement, + inactivePssRequirement, currentCourtAppearance, currentCourtReport, reportManager @@ -227,8 +229,8 @@ class DataLoader( preEvent, StaffGenerator.ALLOCATED, CourtGenerator.PROBATION_AREA, - ZonedDateTime.of(LocalDate.now().minusDays(7), LocalTime.NOON, ZoneId.of("Europe/London")), - ZonedDateTime.of(LocalDate.now().minusDays(10), LocalTime.NOON, ZoneId.of("Europe/London")) + ZonedDateTime.of(LocalDate.now().minusDays(7), LocalTime.NOON, EuropeLondon), + ZonedDateTime.of(LocalDate.now().minusDays(10), LocalTime.NOON, EuropeLondon) ) em.saveAll(preEvent, preSentence, preManager) diff --git a/projects/court-case-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/SentenceGenerator.kt b/projects/court-case-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/SentenceGenerator.kt index f093b999e2..d274055a6c 100644 --- a/projects/court-case-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/SentenceGenerator.kt +++ b/projects/court-case-and-delius/src/dev/kotlin/uk/gov/justice/digital/hmpps/data/generator/SentenceGenerator.kt @@ -357,12 +357,14 @@ object SentenceGenerator { CourtGenerator.PROBATION_AREA ) - fun generatePssRequirement(custodyId: Long, id: Long = IdGenerator.getAndIncrement()) = PssRequirement( - custodyId, - ReferenceDataGenerator.PSS_MAIN_CAT, - ReferenceDataGenerator.PSS_SUB_CAT, - id = id - ) + fun generatePssRequirement(custodyId: Long, id: Long = IdGenerator.getAndIncrement(), active: Boolean) = + PssRequirement( + custodyId, + ReferenceDataGenerator.PSS_MAIN_CAT, + ReferenceDataGenerator.PSS_SUB_CAT, + active = active, + id = id + ) fun generateCourtReport(courtAppearance: CourtAppearance, id: Long = IdGenerator.getAndIncrement()) = CourtReport( diff --git a/projects/court-case-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/PssRequirementsByCrnAndEventIdIntegrationTest.kt b/projects/court-case-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/PssRequirementsByCrnAndEventIdIntegrationTest.kt new file mode 100644 index 0000000000..49bae73193 --- /dev/null +++ b/projects/court-case-and-delius/src/integrationTest/kotlin/uk/gov/justice/digital/hmpps/PssRequirementsByCrnAndEventIdIntegrationTest.kt @@ -0,0 +1,83 @@ +package uk.gov.justice.digital.hmpps + +import org.junit.jupiter.api.Assertions.assertEquals +import org.junit.jupiter.api.Test +import org.springframework.beans.factory.annotation.Autowired +import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc +import org.springframework.boot.test.context.SpringBootTest +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT +import org.springframework.test.web.servlet.MockMvc +import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get +import org.springframework.test.web.servlet.result.MockMvcResultHandlers +import org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath +import org.springframework.test.web.servlet.result.MockMvcResultMatchers.status +import uk.gov.justice.digital.hmpps.api.model.conviction.PssRequirement +import uk.gov.justice.digital.hmpps.api.model.conviction.PssRequirements +import uk.gov.justice.digital.hmpps.api.model.keyValueOf +import uk.gov.justice.digital.hmpps.data.generator.PersonGenerator +import uk.gov.justice.digital.hmpps.data.generator.ReferenceDataGenerator +import uk.gov.justice.digital.hmpps.data.generator.SentenceGenerator +import uk.gov.justice.digital.hmpps.test.MockMvcExtensions.contentAsJson +import uk.gov.justice.digital.hmpps.test.MockMvcExtensions.withToken + +@AutoConfigureMockMvc +@SpringBootTest(webEnvironment = RANDOM_PORT) +internal class PssRequirementsByCrnAndEventIdIntegrationTest { + @Autowired + lateinit var mockMvc: MockMvc + + @Test + fun `unauthorized status returned`() { + val crn = PersonGenerator.CURRENTLY_MANAGED.crn + mockMvc + .perform(get("/probation-case/$crn/convictions/1/pssRequirements")) + .andExpect(status().isUnauthorized) + } + + @Test + fun `API call probation record not found`() { + mockMvc + .perform(get("/probation-case/A123456/convictions/1/pssRequirements").withToken()) + .andExpect(status().isNotFound) + .andExpect(jsonPath("$.message").value("Person with crn of A123456 not found")) + } + + @Test + fun `API call sentence not found`() { + val crn = PersonGenerator.CURRENTLY_MANAGED.crn + + mockMvc + .perform(get("/probation-case/$crn/convictions/3/pssRequirements").withToken()) + .andExpect(status().isNotFound) + .andExpect(jsonPath("$.message").value("Conviction with convictionId 3 not found")) + } + + @Test + fun `API call retuns pss requirements by crn convictionId`() { + val crn = PersonGenerator.CURRENTLY_MANAGED.crn + val event = SentenceGenerator.CURRENTLY_MANAGED + + val pssRequirements = listOf( + PssRequirement( + ReferenceDataGenerator.PSS_MAIN_CAT.keyValueOf(), + ReferenceDataGenerator.PSS_SUB_CAT.keyValueOf(), + true + ), + PssRequirement( + ReferenceDataGenerator.PSS_MAIN_CAT.keyValueOf(), + ReferenceDataGenerator.PSS_SUB_CAT.keyValueOf(), + false + ), + ) + + val expectedResponse = PssRequirements(pssRequirements) + + val response = mockMvc + .perform(get("/probation-case/$crn/convictions/${event.id}/pssRequirements").withToken()) + .andExpect(status().is2xxSuccessful) + .andDo(MockMvcResultHandlers.print()) + .andReturn().response.contentAsJson() + + assertEquals(expectedResponse, response) + } +} \ No newline at end of file diff --git a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/ProbationRecord.kt b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/ProbationRecord.kt index 39d2755b10..c79b38e489 100644 --- a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/ProbationRecord.kt +++ b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/ProbationRecord.kt @@ -4,6 +4,8 @@ import uk.gov.justice.digital.hmpps.integrations.delius.entity.ReferenceData import uk.gov.justice.digital.hmpps.integrations.delius.event.courtappearance.entity.CourtReportType import uk.gov.justice.digital.hmpps.integrations.delius.event.entity.AdRequirementMainCategory import uk.gov.justice.digital.hmpps.integrations.delius.event.entity.RequirementMainCategory +import uk.gov.justice.digital.hmpps.integrations.delius.event.sentence.entity.PssRequirementMainCat +import uk.gov.justice.digital.hmpps.integrations.delius.event.sentence.entity.PssRequirementSubCat import java.time.LocalDate import java.time.ZonedDateTime @@ -11,6 +13,8 @@ fun ReferenceData.keyValueOf() = KeyValue(code, description) fun RequirementMainCategory.keyValueOf() = KeyValue(code, description) fun AdRequirementMainCategory.keyValueOf() = KeyValue(code, description) fun CourtReportType.keyValueOf() = KeyValue(code, description) +fun PssRequirementMainCat.keyValueOf(): KeyValue = KeyValue(code, description) +fun PssRequirementSubCat.keyValueOf(): KeyValue = KeyValue(code, description) data class Conviction( val active: Boolean = false, diff --git a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/conviction/PssRequirements.kt b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/conviction/PssRequirements.kt new file mode 100644 index 0000000000..2405bb8c23 --- /dev/null +++ b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/model/conviction/PssRequirements.kt @@ -0,0 +1,16 @@ +package uk.gov.justice.digital.hmpps.api.model.conviction + +import io.swagger.v3.oas.annotations.media.Schema +import uk.gov.justice.digital.hmpps.api.model.KeyValue + +data class PssRequirements( + @Schema(description = "List of pssRequirements associated with this conviction") + val pssRequirements: List +) + +data class PssRequirement( + val type: KeyValue?, + val subType: KeyValue?, + @Schema(description = "Is the requirement currently active") + val active: Boolean +) \ No newline at end of file diff --git a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/resource/ConvictionResource.kt b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/resource/ConvictionResource.kt index 1ea1d10bb8..a6493e0c6b 100644 --- a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/resource/ConvictionResource.kt +++ b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/resource/ConvictionResource.kt @@ -56,4 +56,10 @@ class ConvictionResource( ) @NotEmpty @RequestParam(required = true) nsiCodes: List ) = interventionService.getNsiByCodes(crn, convictionId, nsiCodes) + + @GetMapping("/{convictionId}/pssRequirements") + fun getPssRequirementsByConvictionId( + @PathVariable crn: String, + @PathVariable convictionId: Long + ) = requirementService.getPssRequirementsByConvictionId(crn, convictionId) } diff --git a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/event/conviction/entity/Requirement.kt b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/event/conviction/entity/Requirement.kt index efbfef80bc..b12243bdd0 100644 --- a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/event/conviction/entity/Requirement.kt +++ b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/event/conviction/entity/Requirement.kt @@ -9,6 +9,7 @@ import uk.gov.justice.digital.hmpps.exception.NotFoundException import uk.gov.justice.digital.hmpps.integrations.delius.entity.ReferenceData import uk.gov.justice.digital.hmpps.integrations.delius.event.entity.AdRequirementMainCategory import uk.gov.justice.digital.hmpps.integrations.delius.event.entity.RequirementMainCategory +import uk.gov.justice.digital.hmpps.integrations.delius.event.sentence.entity.Custody import java.time.LocalDate import java.time.ZonedDateTime import uk.gov.justice.digital.hmpps.api.model.conviction.Requirement as RequirementModel @@ -119,7 +120,10 @@ class Event( val id: Long, @Column(name = "offender_id") - val offenderId: Long + val offenderId: Long, + + @OneToOne(mappedBy = "event") + val disposal: Disposal? = null, ) interface ConvictionEventRepository : JpaRepository { @@ -141,6 +145,25 @@ class Disposal( @OneToOne @JoinColumn(name = "event_id") val event: Event, + + @OneToOne(mappedBy = "disposal") + val custody: Custody?, +) + +@Entity(name = "conviction_custody") +@Table(name = "custody") +@Immutable +class Custody( + @Id + @Column(name = "custody_id") + val id: Long, + + @Column(name = "disposal_id") + val disposalId: Long, + + @OneToOne + @JoinColumn(name = "disposal_id", updatable = false, insertable = false) + val disposal: Disposal, ) interface ConvictionRequirementRepository : JpaRepository { diff --git a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/event/sentence/entity/Disposal.kt b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/event/sentence/entity/Disposal.kt index a1eec9e402..b100f86125 100644 --- a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/event/sentence/entity/Disposal.kt +++ b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/event/sentence/entity/Disposal.kt @@ -223,7 +223,7 @@ class Custody( @Entity @Immutable @Table(name = "pss_rqmnt") -@SQLRestriction("soft_deleted = 0 and active_flag = 1") +@SQLRestriction("soft_deleted = 0") class PssRequirement( @Column(name = "custody_id") diff --git a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/service/RequirementService.kt b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/service/RequirementService.kt index 1a25dd7c72..2f1304339c 100644 --- a/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/service/RequirementService.kt +++ b/projects/court-case-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/service/RequirementService.kt @@ -2,17 +2,24 @@ package uk.gov.justice.digital.hmpps.integrations.delius.service import org.springframework.stereotype.Service import uk.gov.justice.digital.hmpps.api.model.conviction.ConvictionRequirements +import uk.gov.justice.digital.hmpps.api.model.conviction.PssRequirement +import uk.gov.justice.digital.hmpps.api.model.conviction.PssRequirements +import uk.gov.justice.digital.hmpps.api.model.keyValueOf import uk.gov.justice.digital.hmpps.integrations.delius.event.conviction.entity.ConvictionEventRepository import uk.gov.justice.digital.hmpps.integrations.delius.event.conviction.entity.ConvictionRequirementRepository +import uk.gov.justice.digital.hmpps.integrations.delius.event.conviction.entity.Event import uk.gov.justice.digital.hmpps.integrations.delius.event.conviction.entity.getByEventId +import uk.gov.justice.digital.hmpps.integrations.delius.event.sentence.entity.PssRequirementRepository import uk.gov.justice.digital.hmpps.integrations.delius.person.entity.PersonRepository import uk.gov.justice.digital.hmpps.integrations.delius.person.entity.getPerson +import uk.gov.justice.digital.hmpps.integrations.delius.event.sentence.entity.PssRequirement as PssRequirementEntity @Service class RequirementService( private val personRepository: PersonRepository, private val convictionEventRepository: ConvictionEventRepository, - private val convictionRequirementRepository: ConvictionRequirementRepository + private val convictionRequirementRepository: ConvictionRequirementRepository, + private val pssRequirementRepository: PssRequirementRepository ) { fun getRequirementsByConvictionId( crn: String, @@ -20,9 +27,7 @@ class RequirementService( includeInactive: Boolean, includeDeleted: Boolean ): ConvictionRequirements { - - val person = personRepository.getPerson(crn) - val event = convictionEventRepository.getByEventId(convictionId, person.id) + val event = getEventForPersonByCrnAndEventId(crn, convictionId) return ConvictionRequirements( convictionRequirementRepository @@ -30,4 +35,33 @@ class RequirementService( .map { it.toRequirementModel() } ) } -} \ No newline at end of file + + fun getPssRequirementsByConvictionId(crn: String, convictionId: Long): PssRequirements { + val event = getEventForPersonByCrnAndEventId(crn, convictionId) + + return PssRequirements(getPssRequirements(event.disposal?.custody?.id)) + } + + fun getEventForPersonByCrnAndEventId(crn: String, convictionId: Long): Event { + val person = personRepository.getPerson(crn) + return convictionEventRepository.getByEventId(convictionId, person.id) + } + + fun getPssRequirements(custodyId: Long?) = if (custodyId == null) { + listOf() + } else { + pssRequirementRepository.findAllByCustodyId(custodyId).map { + it.toPssRequirement() + } + } +} + +fun PssRequirementEntity.toPssRequirement(): PssRequirement = + PssRequirement( + mainCategory?.let { mainCategory.keyValueOf() }, + subCategory?.let { subCategory.keyValueOf() }, + active + ) + + + diff --git a/projects/court-case-and-delius/src/test/kotlin/uk/gov/justice/digital/hmpps/service/RequirementServiceTest.kt b/projects/court-case-and-delius/src/test/kotlin/uk/gov/justice/digital/hmpps/service/RequirementServiceTest.kt new file mode 100644 index 0000000000..09e9c79577 --- /dev/null +++ b/projects/court-case-and-delius/src/test/kotlin/uk/gov/justice/digital/hmpps/service/RequirementServiceTest.kt @@ -0,0 +1,55 @@ +package uk.gov.justice.digital.hmpps.service + +import org.junit.jupiter.api.Assertions.assertEquals +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +import org.mockito.InjectMocks +import org.mockito.Mock +import org.mockito.junit.jupiter.MockitoExtension +import org.mockito.kotlin.verifyNoInteractions +import org.mockito.kotlin.verifyNoMoreInteractions +import org.mockito.kotlin.whenever +import uk.gov.justice.digital.hmpps.api.model.conviction.PssRequirements +import uk.gov.justice.digital.hmpps.data.generator.PersonGenerator +import uk.gov.justice.digital.hmpps.integrations.delius.event.conviction.entity.ConvictionEventRepository +import uk.gov.justice.digital.hmpps.integrations.delius.event.conviction.entity.ConvictionRequirementRepository +import uk.gov.justice.digital.hmpps.integrations.delius.event.conviction.entity.Event +import uk.gov.justice.digital.hmpps.integrations.delius.event.sentence.entity.PssRequirementRepository +import uk.gov.justice.digital.hmpps.integrations.delius.person.entity.PersonRepository +import uk.gov.justice.digital.hmpps.integrations.delius.service.RequirementService + +@ExtendWith(MockitoExtension::class) +class RequirementServiceTest { + + @Mock + lateinit var personRepository: PersonRepository + + @Mock + lateinit var convictionEventRepository: ConvictionEventRepository + + @Mock + lateinit var convictionRequirementRepository: ConvictionRequirementRepository + + @Mock + lateinit var pssRequirementRepository: PssRequirementRepository + + @InjectMocks + lateinit var requirementService: RequirementService + + @Test + fun `no custody record`() { + val person = PersonGenerator.CURRENTLY_MANAGED + whenever(personRepository.findByCrn(person.crn)).thenReturn(person) + whenever(convictionEventRepository.findEventByIdAndOffenderId(1, person.id)).thenReturn(Event(1, 1)) + + val expectedResponse = PssRequirements(listOf()) + val response = requirementService.getPssRequirementsByConvictionId(person.crn, 1) + + assertEquals(expectedResponse, response) + + verifyNoInteractions(pssRequirementRepository) + verifyNoInteractions(convictionRequirementRepository) + verifyNoMoreInteractions(personRepository) + verifyNoMoreInteractions(convictionEventRepository) + } +} \ No newline at end of file