Commit 40c1e0c 1 parent f155e4d commit 40c1e0c Copy full SHA for 40c1e0c
File tree 3 files changed +33
-0
lines changed
main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/models
test/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/models/createAndVaryLicence
3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ package uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.createAndVaryLicence
2
+ import uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps.Licence
3
+ data class CvlLicence (
4
+ val prisonNumber : String? = null ,
5
+ ) {
6
+ fun toLicence (): Licence = Licence (
7
+ offenderNumber = this .prisonNumber,
8
+ )
9
+ }
Original file line number Diff line number Diff line change
1
+ package uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps
2
+
3
+ data class Licence (
4
+ val offenderNumber : String? = null
5
+ )
Original file line number Diff line number Diff line change
1
+ package uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.createAndVaryLicence
2
+ import io.kotest.core.spec.style.DescribeSpec
3
+ import io.kotest.matchers.shouldBe
4
+
5
+ class LicenceTest : DescribeSpec (
6
+ {
7
+ describe("#toAddress") {
8
+ it("maps one-to-one attributes to integration API attributes") {
9
+ val cvlLcense = CvlLicence (
10
+ prisonNumber = "1140484",
11
+ )
12
+
13
+ val integrationApiLicense = cvlLcense.toLicence()
14
+
15
+ integrationApiLicense.offenderNumber.shouldBe(cvlLcense.prisonNumber)
16
+ }
17
+ }
18
+ },
19
+ )
You can’t perform that action at this time.
0 commit comments