Skip to content

Commit

Permalink
PI-2257 update test
Browse files Browse the repository at this point in the history
Signed-off-by: Amardeep Chimber <[email protected]>
  • Loading branch information
achimber-moj committed Jun 14, 2024
1 parent 1960819 commit c4cabd0
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class DataLoader(
persist(PersonGenerator.RECOMMENDATION_DELETED)
persist(PersonGenerator.RECOMMENDATION_DELETED_INACTIVE_STAFF)
persist(PersonGenerator.RECOMMENDATION_MERGED_FROM)
persist(PersonGenerator.X000010_ADDITIONAL_IDENTIFIER.type)
persist(PersonGenerator.X000010_ADDITIONAL_IDENTIFIER)
persist(PersonGenerator.X000077_ADDITIONAL_IDENTIFIER.mergeDetail)
persist(PersonGenerator.X000077_ADDITIONAL_IDENTIFIER)

persist(PersonGenerator.DEFAULT_PROVIDER)
persist(PersonGenerator.DEFAULT_LAU)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ object PersonGenerator {
val NO_ACCESS_LIMITATIONS = generateUserAccess("X000007")
val RECOMMENDATION_DELETED = generate("X000008")
val RECOMMENDATION_DELETED_INACTIVE_STAFF = generate("X000009")
val RECOMMENDATION_MERGED_FROM = generate("X000010", softDeleted = true)
val X000010_ADDITIONAL_IDENTIFIER =
val RECOMMENDATION_MERGED_FROM = generate("X000077", softDeleted = true)
val X000077_ADDITIONAL_IDENTIFIER =
AdditionalIdentifier(
IdGenerator.getAndIncrement(),
RECOMMENDATION_DELETED.crn,
RECOMMENDATION_MERGED_FROM.crn,
false,
RECOMMENDATION_MERGED_FROM,
RECOMMENDATION_DELETED,
ReferenceData(IdGenerator.getAndIncrement(), "MFCRN", "Merged From CRN")
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"identifiers": [
{
"type": "CRN",
"value": "X000008"
"value": "X000077"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import org.springframework.beans.factory.annotation.Autowired
import org.springframework.beans.factory.annotation.Value
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.boot.test.mock.mockito.MockBean
import org.springframework.test.context.TestPropertySource
import uk.gov.justice.digital.hmpps.data.generator.PersonGenerator
import uk.gov.justice.digital.hmpps.data.generator.UserGenerator
import uk.gov.justice.digital.hmpps.integrations.delius.recommendation.contact.entity.Contact
Expand All @@ -21,7 +20,6 @@ import uk.gov.justice.digital.hmpps.telemetry.TelemetryService
import uk.gov.justice.digital.hmpps.telemetry.notificationReceived

@SpringBootTest
@TestPropertySource(properties = ["logging.level.org.hibernate.SQL=DEBUG", "logging.level.org.hibernate.orm.jdbc.bind=TRACE"])
internal class RecommendationIntegrationTest {
@Value("\${messaging.consumer.queue}")
lateinit var queueName: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface PersonRepository : JpaRepository<Person, Long> {
WHERE ai.crn = :crn
AND p.softDeleted = false
AND p.manager.active = true
AND ai.type.code IN ('DOFF', 'MFCRN', 'MTCRN', 'PCRN')
AND ai.mergeDetail.code IN ('DOFF', 'MFCRN', 'MTCRN', 'PCRN')
"""
)
fun findByCrn(crn: String): Person?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ class AdditionalIdentifier(

@ManyToOne
@JoinColumn(name = "identifier_name_id")
val type: ReferenceData
val mergeDetail: ReferenceData
)

0 comments on commit c4cabd0

Please sign in to comment.