Skip to content

Commit a2ce097

Browse files
committed
ktlint
1 parent 4de2a72 commit a2ce097

File tree

6 files changed

+32
-33
lines changed

6 files changed

+32
-33
lines changed

src/main/kotlin/uk/gov/justice/digital/hmpps/personintegrationapi/common/client/PrisonApiClient.kt

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import org.springframework.web.service.annotation.PutExchange
99
import uk.gov.justice.digital.hmpps.personintegrationapi.common.client.dto.UpdateBirthCountry
1010
import uk.gov.justice.digital.hmpps.personintegrationapi.common.client.request.UpdateBirthPlace
1111
import uk.gov.justice.digital.hmpps.personintegrationapi.common.client.request.UpdateNationality
12-
import uk.gov.justice.digital.hmpps.personintegrationapi.common.client.response.MilitaryRecord
1312
import uk.gov.justice.digital.hmpps.personintegrationapi.common.client.response.MilitaryRecordPrisonDto
1413

1514
@HttpExchange("/api/offenders")

src/main/kotlin/uk/gov/justice/digital/hmpps/personintegrationapi/common/client/response/MilitaryRecord.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package uk.gov.justice.digital.hmpps.personintegrationapi.common.client.response
33
import java.time.LocalDate
44

55
data class MilitaryRecordPrisonDto(
6-
val militaryRecords: List<MilitaryRecord>
6+
val militaryRecords: List<MilitaryRecord>,
77
)
88

99
data class MilitaryRecord(
@@ -24,5 +24,5 @@ data class MilitaryRecord(
2424
val militaryRankDescription: String?,
2525
val serviceNumber: String?,
2626
val disciplinaryActionCode: String?,
27-
val disciplinaryActionDescription: String?
28-
)
27+
val disciplinaryActionDescription: String?,
28+
)
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,118 @@
11
package uk.gov.justice.digital.hmpps.personintegrationapi.corepersonrecord.dto.response
22

3-
import java.time.LocalDate
43
import com.fasterxml.jackson.annotation.JsonInclude
54
import com.fasterxml.jackson.annotation.JsonInclude.Include
65
import io.swagger.v3.oas.annotations.media.Schema
6+
import java.time.LocalDate
77

88
@JsonInclude(Include.NON_NULL)
99
@Schema(description = "DTO representing a military record with details about service in the UK Armed Forces.")
1010
data class MilitaryRecordDto(
1111
@Schema(
1212
description = "Code identifying the war zone where the service took place.",
13-
example = "AFG"
13+
example = "AFG",
1414
)
1515
val warZoneCode: String?,
1616

1717
@Schema(
1818
description = "Description of the war zone where the service took place.",
19-
example = "Afghanistan"
19+
example = "Afghanistan",
2020
)
2121
val warZoneDescription: String?,
2222

2323
@Schema(
2424
description = "Start date of the military service.",
25-
example = "2017-06-01"
25+
example = "2017-06-01",
2626
)
2727
val startDate: LocalDate,
2828

2929
@Schema(
3030
description = "End date of the military service, if applicable.",
31-
example = "2019-12-01"
31+
example = "2019-12-01",
3232
)
3333
val endDate: LocalDate?,
3434

3535
@Schema(
3636
description = "Code indicating the discharge status from the UK military forces.",
37-
example = "HON"
37+
example = "HON",
3838
)
3939
val militaryDischargeCode: String?,
4040

4141
@Schema(
4242
description = "Description of the discharge status from the UK military forces.",
43-
example = "Honourable"
43+
example = "Honourable",
4444
)
4545
val militaryDischargeDescription: String?,
4646

4747
@Schema(
4848
description = "Code identifying the branch of the UK military in which the individual served.",
49-
example = "ARM"
49+
example = "ARM",
5050
)
5151
val militaryBranchCode: String,
5252

5353
@Schema(
5454
description = "Description of the military branch of the UK Armed Forces.",
55-
example = "Army"
55+
example = "Army",
5656
)
5757
val militaryBranchDescription: String,
5858

5959
@Schema(
6060
description = "Additional notes or details about the military service.",
61-
example = "Deployed to Afghanistan in support of Operation Herrick."
61+
example = "Deployed to Afghanistan in support of Operation Herrick.",
6262
)
6363
val description: String?,
6464

6565
@Schema(
6666
description = "Unit number in which the individual served.",
67-
example = "2nd Battalion, The Royal Anglian Regiment"
67+
example = "2nd Battalion, The Royal Anglian Regiment",
6868
)
6969
val unitNumber: String?,
7070

7171
@Schema(
7272
description = "Location where the individual enlisted in the UK military.",
73-
example = "Windsor, Berkshire"
73+
example = "Windsor, Berkshire",
7474
)
7575
val enlistmentLocation: String?,
7676

7777
@Schema(
7878
description = "Location where the individual was discharged from the UK military.",
79-
example = "Colchester, Essex"
79+
example = "Colchester, Essex",
8080
)
8181
val dischargeLocation: String?,
8282

8383
@Schema(
8484
description = "Flag indicating if the individual was registered for UK selective military service (National Service).",
85-
example = "false"
85+
example = "false",
8686
)
8787
val selectiveServicesFlag: Boolean,
8888

8989
@Schema(
9090
description = "Code identifying the individual's military rank in the UK forces.",
91-
example = "CPL_ARM"
91+
example = "CPL_ARM",
9292
)
9393
val militaryRankCode: String?,
9494

9595
@Schema(
9696
description = "Description of the individual's military rank in the UK forces.",
97-
example = "Corporal"
97+
example = "Corporal",
9898
)
9999
val militaryRankDescription: String?,
100100

101101
@Schema(
102102
description = "Service number of the individual within the UK military.",
103-
example = "2345678"
103+
example = "2345678",
104104
)
105105
val serviceNumber: String?,
106106

107107
@Schema(
108108
description = "Code identifying any disciplinary actions taken against the individual during service.",
109-
example = "CM"
109+
example = "CM",
110110
)
111111
val disciplinaryActionCode: String?,
112112

113113
@Schema(
114114
description = "Description of any disciplinary actions taken against the individual during service.",
115-
example = "Court Martial"
115+
example = "Court Martial",
116116
)
117-
val disciplinaryActionDescription: String?
117+
val disciplinaryActionDescription: String?,
118118
)

src/main/kotlin/uk/gov/justice/digital/hmpps/personintegrationapi/corepersonrecord/service/CorePersonRecordService.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class CorePersonRecordService(
7171
val mappedResponse = response.body?.militaryRecords?.map {
7272
it.copy(
7373
militaryRankDescription = it.militaryRankDescription?.replace(rankSuffixPattern, "")?.trim(),
74-
)
74+
)
7575
MilitaryRecordDto(
7676
warZoneCode = it.warZoneCode,
7777
warZoneDescription = it.warZoneDescription,

src/test/kotlin/uk/gov/justice/digital/hmpps/personintegrationapi/corepersonrecord/resource/CorePersonRecordV1ResourceIntTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ class CorePersonRecordV1ResourceIntTest : IntegrationTestBase() {
253253
militaryRankDescription = "Military Rank One",
254254
serviceNumber = "Service Number One",
255255
disciplinaryActionCode = "DA1",
256-
disciplinaryActionDescription = "Disciplinary Action One"
256+
disciplinaryActionDescription = "Disciplinary Action One",
257257
),
258258
MilitaryRecordDto(
259259
warZoneCode = "WZ2",

src/test/kotlin/uk/gov/justice/digital/hmpps/personintegrationapi/corepersonrecord/service/CorePersonRecordServiceTest.kt

+7-7
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ class CorePersonRecordServiceTest {
145145
militaryRankDescription = "Military Rank One (Army)",
146146
serviceNumber = "Service Number One",
147147
disciplinaryActionCode = "DA1",
148-
disciplinaryActionDescription = "Disciplinary Action One"
149-
)
150-
)
148+
disciplinaryActionDescription = "Disciplinary Action One",
149+
),
150+
),
151151
)
152152

153153
private val militaryRecords = listOf(
@@ -169,14 +169,14 @@ class CorePersonRecordServiceTest {
169169
militaryRankDescription = "Military Rank One",
170170
serviceNumber = "Service Number One",
171171
disciplinaryActionCode = "DA1",
172-
disciplinaryActionDescription = "Disciplinary Action One"
173-
)
172+
disciplinaryActionDescription = "Disciplinary Action One",
173+
),
174174
)
175175

176176
@Test
177177
fun `can retrieve military records`() {
178178
whenever(prisonApiClient.getMilitaryRecords(prisonerNumber)).thenReturn(
179-
ResponseEntity.ok(militaryRecordsPrisonDto)
179+
ResponseEntity.ok(militaryRecordsPrisonDto),
180180
)
181181

182182
val response = underTest.getMilitaryRecords(prisonerNumber)
@@ -188,7 +188,7 @@ class CorePersonRecordServiceTest {
188188
@ValueSource(ints = [400, 401, 403, 404, 422, 500])
189189
fun `propagates non-2xx status codes`(status: Int) {
190190
whenever(prisonApiClient.getMilitaryRecords(prisonerNumber)).thenReturn(
191-
ResponseEntity.status(status).build()
191+
ResponseEntity.status(status).build(),
192192
)
193193

194194
val response = underTest.getMilitaryRecords(prisonerNumber)

0 commit comments

Comments
 (0)