Fixes a bug in the deserialisation of UniqueIdentifiers in the CRaSH shell.

This commit is contained in:
Joel Dudley 2018-01-23 17:28:24 +00:00 committed by GitHub
parent 142f52fa82
commit 5df50c0e81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -528,7 +528,7 @@ object InteractiveShell {
return UniqueIdentifier(ids[0], uuid)
}
//Any other string used as externalId.
return UniqueIdentifier(p.text)
return UniqueIdentifier.fromString(p.text)
}
}

View File

@ -34,10 +34,11 @@ class CustomTypeJsonParsingTests {
@Test
fun `Deserializing UniqueIdentifier by parsing string`() {
val json = """{"linearId":"26b37265-a1fd-4c77-b2e0-715917ef619f"}"""
val id = "26b37265-a1fd-4c77-b2e0-715917ef619f"
val json = """{"linearId":"$id"}"""
val state = objectMapper.readValue<State>(json)
assertEquals("26b37265-a1fd-4c77-b2e0-715917ef619f", state.linearId.externalId)
assertEquals(id, state.linearId.id.toString())
}
@Test