Skip to content

Commit 6f998dd

Browse files
Bump io.sentry:sentry-spring-boot-starter from 7.6.0 to 7.7.0 (#709)
* Bump io.sentry:sentry-spring-boot-starter from 7.6.0 to 7.7.0 Bumps [io.sentry:sentry-spring-boot-starter](https://github.com/getsentry/sentry-java) from 7.6.0 to 7.7.0. - [Release notes](https://github.com/getsentry/sentry-java/releases) - [Changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md) - [Commits](getsentry/sentry-java@7.6.0...7.7.0) --- updated-dependencies: - dependency-name: io.sentry:sentry-spring-boot-starter dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Formatting changes --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 6eff101 commit 6f998dd

22 files changed

+254
-58
lines changed

build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies {
2626

2727
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.5.0")
2828

29-
implementation("io.sentry:sentry-spring-boot-starter:7.6.0")
29+
implementation("io.sentry:sentry-spring-boot-starter:7.7.0")
3030

3131
implementation("uk.gov.justice.service.hmpps:hmpps-sqs-spring-boot-starter:3.1.2")
3232
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")

src/main/kotlin/uk/gov/justice/hmpps/probationsearch/controllers/OffenderSearchController.kt

+94-20
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ class OffenderSearchController(
8181
)
8282
@PreAuthorize("hasAnyRole('ROLE_COMMUNITY', 'ROLE_PROBATION__SEARCH_PERSON')")
8383
@RequestMapping("/search", method = [POST, GET])
84-
fun searchOffenders(@RequestBody searchForm: SearchDto): List<OffenderDetail?>? = searchService.performSearch(searchForm)
84+
fun searchOffenders(@RequestBody searchForm: SearchDto): List<OffenderDetail?>? =
85+
searchService.performSearch(searchForm)
8586

8687
@Operation(
8788
summary = "Search for an offender in Delius using a search phrase. Only offenders matching all request attributes will be returned",
@@ -123,8 +124,16 @@ class OffenderSearchController(
123124
@ApiResponses(
124125
value = [
125126
ApiResponse(responseCode = "200", description = "OK"),
126-
ApiResponse(responseCode = "401", description = "Unauthorised, requires a valid Oauth2 token", content = [Content(examples = [])]),
127-
ApiResponse(responseCode = "403", description = "Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON", content = [Content(examples = [])]),
127+
ApiResponse(
128+
responseCode = "401",
129+
description = "Unauthorised, requires a valid Oauth2 token",
130+
content = [Content(examples = [])]
131+
),
132+
ApiResponse(
133+
responseCode = "403",
134+
description = "Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON",
135+
content = [Content(examples = [])]
136+
),
128137
],
129138
)
130139
@PostMapping("/phrase")
@@ -143,9 +152,21 @@ class OffenderSearchController(
143152
@ApiResponses(
144153
value = [
145154
ApiResponse(responseCode = "200", description = "OK"),
146-
ApiResponse(responseCode = "401", description = "Unauthorised, requires a valid Oauth2 token", content = [Content(examples = [])]),
147-
ApiResponse(responseCode = "403", description = "Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON", content = [Content(examples = [])]),
148-
ApiResponse(responseCode = "500", description = "The list of CRNs provided exceeds the maximum of 512", content = [Content(examples = [])]),
155+
ApiResponse(
156+
responseCode = "401",
157+
description = "Unauthorised, requires a valid Oauth2 token",
158+
content = [Content(examples = [])]
159+
),
160+
ApiResponse(
161+
responseCode = "403",
162+
description = "Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON",
163+
content = [Content(examples = [])]
164+
),
165+
ApiResponse(
166+
responseCode = "500",
167+
description = "The list of CRNs provided exceeds the maximum of 512",
168+
content = [Content(examples = [])]
169+
),
149170
],
150171
)
151172
@PostMapping("/crns")
@@ -169,12 +190,23 @@ class OffenderSearchController(
169190
@ApiResponses(
170191
value = [
171192
ApiResponse(responseCode = "200", description = "OK"),
172-
ApiResponse(responseCode = "401", description = "Unauthorised, requires a valid Oauth2 token", content = [Content(examples = [])]),
173-
ApiResponse(responseCode = "403", description = "Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON", content = [Content(examples = [])]),
193+
ApiResponse(
194+
responseCode = "401",
195+
description = "Unauthorised, requires a valid Oauth2 token",
196+
content = [Content(examples = [])]
197+
),
198+
ApiResponse(
199+
responseCode = "403",
200+
description = "Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON",
201+
content = [Content(examples = [])]
202+
),
174203
],
175204
)
176205
@PostMapping("/nomsNumbers")
177-
@Operation(description = "Match prisoners by a list of prisoner noms numbers", summary = "Requires ROLE_PROBATION__SEARCH_PERSON role")
206+
@Operation(
207+
description = "Match prisoners by a list of prisoner noms numbers",
208+
summary = "Requires ROLE_PROBATION__SEARCH_PERSON role"
209+
)
178210
fun findByNomsNumbers(
179211
@Parameter(required = true, name = "nomsList") @RequestBody nomsList: List<String>,
180212
): List<OffenderDetail> {
@@ -185,8 +217,16 @@ class OffenderSearchController(
185217
@ApiResponses(
186218
value = [
187219
ApiResponse(responseCode = "200", description = "OK"),
188-
ApiResponse(responseCode = "401", description = "Unauthorised, requires a valid Oauth2 token", content = [Content(examples = [])]),
189-
ApiResponse(responseCode = "403", description = "Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON", content = [Content(examples = [])]),
220+
ApiResponse(
221+
responseCode = "401",
222+
description = "Unauthorised, requires a valid Oauth2 token",
223+
content = [Content(examples = [])]
224+
),
225+
ApiResponse(
226+
responseCode = "403",
227+
description = "Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON",
228+
content = [Content(examples = [])]
229+
),
190230
],
191231
)
192232
@PostMapping("/ldu-codes")
@@ -202,7 +242,10 @@ class OffenderSearchController(
202242
example = "10",
203243
),
204244
)
205-
@Operation(summary = "Match prisoners by a list of ldu codes", description = "Requires ROLE_PROBATION__SEARCH_PERSON role")
245+
@Operation(
246+
summary = "Match prisoners by a list of ldu codes",
247+
description = "Requires ROLE_PROBATION__SEARCH_PERSON role"
248+
)
206249
fun findByLduCode(
207250
@Parameter(required = true, name = "lduList")
208251
@RequestBody
@@ -218,8 +261,16 @@ class OffenderSearchController(
218261
@ApiResponses(
219262
value = [
220263
ApiResponse(responseCode = "200", description = "OK"),
221-
ApiResponse(responseCode = "401", description = "Unauthorised, requires a valid Oauth2 token", content = [Content(examples = [])]),
222-
ApiResponse(responseCode = "403", description = "Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON", content = [Content(examples = [])]),
264+
ApiResponse(
265+
responseCode = "401",
266+
description = "Unauthorised, requires a valid Oauth2 token",
267+
content = [Content(examples = [])]
268+
),
269+
ApiResponse(
270+
responseCode = "403",
271+
description = "Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON",
272+
content = [Content(examples = [])]
273+
),
223274
],
224275
)
225276
@PostMapping("/team-codes")
@@ -235,7 +286,10 @@ class OffenderSearchController(
235286
example = "10",
236287
),
237288
)
238-
@Operation(description = "Match prisoners by a list of team codes", summary = "Requires ROLE_PROBATION__SEARCH_PERSON role")
289+
@Operation(
290+
description = "Match prisoners by a list of team codes",
291+
summary = "Requires ROLE_PROBATION__SEARCH_PERSON role"
292+
)
239293
fun findByTeamCode(
240294
@Parameter(required = true, name = "teamCodeList")
241295
@ParameterObject
@@ -261,8 +315,16 @@ class OffenderSearchController(
261315
content = [Content(examples = [])],
262316
),
263317
ApiResponse(responseCode = "404", description = "Not found", content = [Content(examples = [])]),
264-
ApiResponse(responseCode = "401", description = "Unauthorised, requires a valid Oauth2 token", content = [Content(examples = [])]),
265-
ApiResponse(responseCode = "403", description = "Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON", content = [Content(examples = [])]),
318+
ApiResponse(
319+
responseCode = "401",
320+
description = "Unauthorised, requires a valid Oauth2 token",
321+
content = [Content(examples = [])]
322+
),
323+
ApiResponse(
324+
responseCode = "403",
325+
description = "Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON",
326+
content = [Content(examples = [])]
327+
),
266328
],
267329
)
268330
@GetMapping("/ldu-codes/{lduCode}")
@@ -286,8 +348,16 @@ class OffenderSearchController(
286348
content = [Content(examples = [])],
287349
),
288350
ApiResponse(responseCode = "404", description = "Not found", content = [Content(examples = [])]),
289-
ApiResponse(responseCode = "401", description = "Unauthorised, requires a valid Oauth2 token", content = [Content(examples = [])]),
290-
ApiResponse(responseCode = "403", description = "Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON", content = [Content(examples = [])]),
351+
ApiResponse(
352+
responseCode = "401",
353+
description = "Unauthorised, requires a valid Oauth2 token",
354+
content = [Content(examples = [])]
355+
),
356+
ApiResponse(
357+
responseCode = "403",
358+
description = "Forbidden, requires an authorisation with role ROLE_PROBATION__SEARCH_PERSON",
359+
content = [Content(examples = [])]
360+
),
291361
],
292362
)
293363
@GetMapping("/team-codes/{teamCode}")
@@ -302,6 +372,10 @@ class OffenderSearchController(
302372
val start = System.currentTimeMillis()
303373
val results = searchService.performSearch(SearchDto(surname = "Smith"))
304374

305-
telemetryClient.trackEvent("synthetic-monitor", mapOf("results" to "${results.size}", "timeMs" to (System.currentTimeMillis() - start).toString()), null)
375+
telemetryClient.trackEvent(
376+
"synthetic-monitor",
377+
mapOf("results" to "${results.size}", "timeMs" to (System.currentTimeMillis() - start).toString()),
378+
null
379+
)
306380
}
307381
}

src/main/kotlin/uk/gov/justice/hmpps/probationsearch/controllers/advice/ErrorResponse.kt

+10-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ data class ErrorResponse(
1010
@Schema(required = false, description = "Developer Information message", example = "System is down")
1111
val developerMessage: String? = null,
1212
@Schema(required = true, description = "Internal Error Code", example = "20012") val errorCode: Int? = null,
13-
@Schema(required = true, description = "Error message information", example = "Offender Not Found") val userMessage: String? = null,
14-
@Schema(required = false, description = "Additional information about the error", example = "Hard disk failure") val moreInfo: String? = null,
13+
@Schema(
14+
required = true,
15+
description = "Error message information",
16+
example = "Offender Not Found"
17+
) val userMessage: String? = null,
18+
@Schema(
19+
required = false,
20+
description = "Additional information about the error",
21+
example = "Hard disk failure"
22+
) val moreInfo: String? = null,
1523
)

src/main/kotlin/uk/gov/justice/hmpps/probationsearch/dto/MatchRequest.kt

+12-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,17 @@ data class MatchRequest(
1313
@field:Past(message = "Date of birth must be in the past")
1414
@Schema(description = "Offender date of birth", example = "1996-02-10")
1515
val dateOfBirth: LocalDate? = null,
16-
@Schema(description = "Police National Computer (PNC) number", example = "2018/0123456X") val pncNumber: String? = null,
16+
@Schema(
17+
description = "Police National Computer (PNC) number",
18+
example = "2018/0123456X"
19+
) val pncNumber: String? = null,
1720
@Schema(description = "Criminal Records Office (CRO) number", example = "SF80/655108T") val croNumber: String? = null,
18-
@Schema(description = "The Offender NOMIS Id (aka prison number/offender no in DPS)", example = "G5555TT") val nomsNumber: String? = null,
19-
@Schema(description = "Filter so only offenders on a current sentence managed by probation will be returned", example = "true") val activeSentence: Boolean = false,
21+
@Schema(
22+
description = "The Offender NOMIS Id (aka prison number/offender no in DPS)",
23+
example = "G5555TT"
24+
) val nomsNumber: String? = null,
25+
@Schema(
26+
description = "Filter so only offenders on a current sentence managed by probation will be returned",
27+
example = "true"
28+
) val activeSentence: Boolean = false,
2029
)

src/main/kotlin/uk/gov/justice/hmpps/probationsearch/dto/OffenderDetail.kt

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ data class OffenderDetail(
2727
val restrictionMessage: String? = null,
2828
val currentExclusion: Boolean? = null,
2929
val exclusionMessage: String? = null,
30-
@Schema(description = "map of fields which matched a search term (Only return for phrase searching)", example = "{\"surname\": [\"Smith\"], \"offenderAliases.surname\": [\"SMITH\"]}")
30+
@Schema(
31+
description = "map of fields which matched a search term (Only return for phrase searching)",
32+
example = "{\"surname\": [\"Smith\"], \"offenderAliases.surname\": [\"SMITH\"]}"
33+
)
3134
val highlight: Map<String, List<String>>? = null,
3235
val accessDenied: Boolean? = null,
3336
val currentTier: String? = null,

src/main/kotlin/uk/gov/justice/hmpps/probationsearch/dto/SearchDto.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ data class SearchDto(
1717
) {
1818
@get:Schema(hidden = true)
1919
val isValid: Boolean
20-
get() = StringUtils.isNotBlank(firstName) || StringUtils.isNotBlank(surname) || dateOfBirth != null || StringUtils.isNotBlank(pncNumber) || StringUtils.isNotBlank(crn) ||
20+
get() = StringUtils.isNotBlank(firstName) || StringUtils.isNotBlank(surname) || dateOfBirth != null || StringUtils.isNotBlank(
21+
pncNumber
22+
) || StringUtils.isNotBlank(crn) ||
2123
StringUtils.isNotBlank(nomsNumber) || StringUtils.isNotBlank(croNumber)
2224
}

src/main/kotlin/uk/gov/justice/hmpps/probationsearch/dto/SearchPhraseFilter.kt

+9-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ data class SearchPhraseFilter(
77
@field:NotBlank(message = "phrase must be supplied")
88
@Schema(required = true, description = "Phrase containing the terms to search for", example = "john smith 19/07/1965")
99
val phrase: String = "",
10-
@Schema(required = false, description = "When true, only match offenders that match all terms. Analogous to AND versus OR") val matchAllTerms: Boolean = false,
11-
@Schema(required = false, description = "Filter of probation area codes. Only offenders that have an active offender manager in one of the areas will be returned", example = "[\"N01\",\"N02\"]") val probationAreasFilter: List<String> = listOf(),
10+
@Schema(
11+
required = false,
12+
description = "When true, only match offenders that match all terms. Analogous to AND versus OR"
13+
) val matchAllTerms: Boolean = false,
14+
@Schema(
15+
required = false,
16+
description = "Filter of probation area codes. Only offenders that have an active offender manager in one of the areas will be returned",
17+
example = "[\"N01\",\"N02\"]"
18+
) val probationAreasFilter: List<String> = listOf(),
1219
)

src/main/kotlin/uk/gov/justice/hmpps/probationsearch/dto/Team.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ import io.swagger.v3.oas.annotations.media.Schema
55
data class Team(
66
@Schema(description = "Team code", example = "C01T04") val code: String? = null,
77
@Schema(description = "Team description", example = "OMU A") val description: String? = null,
8-
@Schema(description = "Team telephone, often not populated", required = false, example = "OMU A") val telephone: String? = null,
8+
@Schema(
9+
description = "Team telephone, often not populated",
10+
required = false,
11+
example = "OMU A"
12+
) val telephone: String? = null,
913
@Schema(description = "Local Delivery Unit - LDU") val localDeliveryUnit: KeyValue? = null,
1014
@Schema(description = "Team's district") val district: KeyValue? = null,
1115
@Schema(description = "Team's borough") val borough: KeyValue? = null,

src/main/kotlin/uk/gov/justice/hmpps/probationsearch/health/HealthCheck.kt

+9-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,19 @@ abstract class HealthCheck(private val webClient: WebClient, private val timeout
1818
.retrieve()
1919
.toEntity(String::class.java)
2020
.flatMap { Mono.just(Health.up().withDetail("HttpStatus", it?.statusCode).build()) }
21-
.onErrorResume(WebClientResponseException::class.java) { Mono.just(Health.down(it).withDetail("body", it.responseBodyAsString).withDetail("HttpStatus", it.statusCode).build()) }
21+
.onErrorResume(WebClientResponseException::class.java) {
22+
Mono.just(
23+
Health.down(it).withDetail("body", it.responseBodyAsString).withDetail("HttpStatus", it.statusCode).build()
24+
)
25+
}
2226
.onErrorResume(Exception::class.java) { Mono.just(Health.down(it).build()) }
2327
.block(timeout)
2428
}
2529
}
2630

2731
@Component
2832
class CommunityApiHealth
29-
constructor(@Qualifier("communityApiHealthWebClient") webClient: WebClient, @Value("\${api.health-timeout:2s}") timeout: Duration) : HealthCheck(webClient, timeout)
33+
constructor(
34+
@Qualifier("communityApiHealthWebClient") webClient: WebClient,
35+
@Value("\${api.health-timeout:2s}") timeout: Duration
36+
) : HealthCheck(webClient, timeout)

src/main/kotlin/uk/gov/justice/hmpps/probationsearch/security/AuthAwareTokenConverter.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import org.springframework.security.oauth2.server.resource.authentication.JwtAut
99
import org.springframework.security.oauth2.server.resource.authentication.JwtGrantedAuthoritiesConverter
1010

1111
class AuthAwareTokenConverter : Converter<Jwt, AbstractAuthenticationToken> {
12-
private val jwtGrantedAuthoritiesConverter: Converter<Jwt, Collection<GrantedAuthority>> = JwtGrantedAuthoritiesConverter()
12+
private val jwtGrantedAuthoritiesConverter: Converter<Jwt, Collection<GrantedAuthority>> =
13+
JwtGrantedAuthoritiesConverter()
1314

1415
override fun convert(jwt: Jwt): AbstractAuthenticationToken {
1516
return AuthAwareAuthenticationToken(

src/main/kotlin/uk/gov/justice/hmpps/probationsearch/services/SearchClient.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ import org.springframework.stereotype.Service
1111
class SearchClient(
1212
@param:Qualifier("openSearchClient") private val openSearchClient: RestHighLevelClient,
1313
) {
14-
fun search(searchRequest: SearchRequest): SearchResponse = openSearchClient.search(searchRequest, RequestOptions.DEFAULT)
14+
fun search(searchRequest: SearchRequest): SearchResponse =
15+
openSearchClient.search(searchRequest, RequestOptions.DEFAULT)
1516
}

src/main/kotlin/uk/gov/justice/hmpps/probationsearch/services/TermHighlighter.kt

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ internal fun buildHighlightRequest() = HighlightBuilder()
1111
.preTags("")
1212
.postTags("")
1313

14-
internal fun OffenderDetail.mergeHighlights(highlightFields: Map<String, HighlightField>, phrase: String): OffenderDetail =
14+
internal fun OffenderDetail.mergeHighlights(
15+
highlightFields: Map<String, HighlightField>,
16+
phrase: String
17+
): OffenderDetail =
1518
this.copy(highlight = extractHighlights(highlightFields) + possibleDateOfBirthHighlight(phrase))
1619

1720
private fun OffenderDetail.possibleDateOfBirthHighlight(phrase: String): Map<String, List<String>> {

src/test/kotlin/uk/gov/justice/hmpps/probationsearch/controllers/ElasticIntegrationBase.kt

+8-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,14 @@ abstract class ElasticIntegrationBase {
9393
it.offenderManagers.find { replacement -> replacement.active == offenderManager.active }
9494
.let { matchingReplacement ->
9595
offenderManager.copy(
96-
probationArea = ProbationArea(code = matchingReplacement?.code, description = matchingReplacement?.description),
97-
team = Team(code = matchingReplacement?.team?.code, localDeliveryUnit = matchingReplacement?.team?.localDeliveryUnit),
96+
probationArea = ProbationArea(
97+
code = matchingReplacement?.code,
98+
description = matchingReplacement?.description
99+
),
100+
team = Team(
101+
code = matchingReplacement?.team?.code,
102+
localDeliveryUnit = matchingReplacement?.team?.localDeliveryUnit
103+
),
98104
softDeleted = matchingReplacement?.softDeleted,
99105
)
100106
}

src/test/kotlin/uk/gov/justice/hmpps/probationsearch/controllers/OffenderSearchPhraseAPIIntegrationTest.kt

+7-1
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,13 @@ class OffenderSearchPhraseAPIIntegrationTest : ElasticIntegrationBase() {
10971097
OffenderReplacement(
10981098
crn = "X00006",
10991099
surname = "Gramsci",
1100-
offenderManagers = listOf(OffenderManagerReplacement(code = "N07", description = "NPS London", active = true)),
1100+
offenderManagers = listOf(
1101+
OffenderManagerReplacement(
1102+
code = "N07",
1103+
description = "NPS London",
1104+
active = true
1105+
)
1106+
),
11011107
),
11021108
OffenderReplacement(
11031109
crn = "X00007",

src/test/kotlin/uk/gov/justice/hmpps/probationsearch/controllers/ProbationStatusIntegrationTest.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ class ProbationStatusIntegrationTest : ElasticIntegrationBase() {
9797
assertThatJson(response).node("matches[0].offender.probationStatus.inBreach").isEqualTo(true)
9898
assertThatJson(response).node("matches[0].offender.probationStatus.awaitingPsr").isEqualTo(true)
9999
assertThatJson(response).node("matches[0].offender.probationStatus.preSentenceActivity").isEqualTo(false)
100-
assertThatJson(response).node("matches[0].offender.probationStatus.previouslyKnownTerminationDate").isEqualTo("2021-02-08")
100+
assertThatJson(response).node("matches[0].offender.probationStatus.previouslyKnownTerminationDate")
101+
.isEqualTo("2021-02-08")
101102
}
102103

103104
@Test

src/test/kotlin/uk/gov/justice/hmpps/probationsearch/dto/OffenderDetailTest.kt

+7-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ internal class OffenderDetailTest {
99
@Test
1010
fun `age is calculated from date of birth`() {
1111
val expectedAge = LocalDate.now().year - 2000
12-
assertThat(OffenderDetail(otherIds = IDs("1234"), offenderId = 99, dateOfBirth = LocalDate.parse("2000-01-01")).age).isEqualTo(expectedAge)
12+
assertThat(
13+
OffenderDetail(
14+
otherIds = IDs("1234"),
15+
offenderId = 99,
16+
dateOfBirth = LocalDate.parse("2000-01-01")
17+
).age
18+
).isEqualTo(expectedAge)
1319
}
1420

1521
@Test

0 commit comments

Comments
 (0)