Skip to content

Commit 524cdec

Browse files
API method to return the Review schedule
1 parent 0b43828 commit 524cdec

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/services/GetReviewScheduleForPersonService.kt

+7-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ class GetReviewScheduleForPersonService(
1616
val response = getPersonService.getNomisNumber(hmppsId = hmppsId)
1717

1818
response.data?.nomisNumber?.let {
19-
return Response(ReviewSchedule(
20-
deadlineDate = LocalDate.now().plusMonths(1),
21-
nomisNumber = it,
22-
description = "This is a hardcoded response."))
19+
return Response(
20+
ReviewSchedule(
21+
deadlineDate = LocalDate.now().plusMonths(1),
22+
nomisNumber = it,
23+
description = "This is a hardcoded response.",
24+
),
25+
)
2326
// return plpGateway.getReviewSchedule(it) // <-- this will be call the PLP service once the downstream code is written
2427
}
2528
return Response(ReviewSchedule(), response.errors)

src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/controllers/v1/person/ReviewScheduleTest.kt src/test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/controllers/v1/person/InductionScheduleTest.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import com.fasterxml.jackson.databind.ObjectMapper
44
import org.junit.jupiter.api.Assertions.assertEquals
55
import org.junit.jupiter.api.Assertions.assertNull
66
import org.junit.jupiter.api.Test
7-
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.ReviewSchedule
7+
import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.InductionSchedule
88
import java.time.Instant
99
import java.time.LocalDate
1010

11-
class ReviewScheduleTest {
11+
class InductionScheduleTest {
1212
private val objectMapper =
1313
ObjectMapper().apply {
1414
// Register the custom deserializer
@@ -34,7 +34,7 @@ class ReviewScheduleTest {
3434
"""
3535

3636
// When
37-
val result = objectMapper.readValue(json, ReviewSchedule::class.java)
37+
val result = objectMapper.readValue(json, InductionSchedule::class.java)
3838

3939
// Then
4040
assertEquals("A1234BC", result.nomisNumber)
@@ -57,7 +57,7 @@ class ReviewScheduleTest {
5757
"""
5858

5959
// When
60-
val result = objectMapper.readValue(json, ReviewSchedule::class.java)
60+
val result = objectMapper.readValue(json, InductionSchedule::class.java)
6161

6262
// Then
6363
assertEquals("A1234BC", result.nomisNumber)
@@ -87,7 +87,7 @@ class ReviewScheduleTest {
8787
"""
8888

8989
// When
90-
val result = objectMapper.readValue(json, ReviewSchedule::class.java)
90+
val result = objectMapper.readValue(json, InductionSchedule::class.java)
9191

9292
// Then
9393
assertEquals("A1234BC", result.nomisNumber)

0 commit comments

Comments
 (0)