Skip to content

Commit

Permalink
Additional test case
Browse files Browse the repository at this point in the history
  • Loading branch information
miensol committed Jun 26, 2023
1 parent 69cea7e commit a89a5a1
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class CodifiedJacksonModuleTest {
}

@Test
fun `can serialize and deserialize not known value to enum property`() {
fun `can deserialize not known value to enum property`() {
// given
val input = """{"colour": "pink"}"""
// when
Expand All @@ -82,6 +82,16 @@ class CodifiedJacksonModuleTest {
output.colour.shouldEqual(null)
}

@Test
fun `can deserialize known value to enum property`() {
// given
val input = """{"colour": "blue"}"""
// when
val output = objectMapper.readValue(input, HasColour::class.java)
// then
output.colour.shouldEqual(Colour.Blue)
}

@Test
fun `can deserialize known value to codified enum property`() {
// given
Expand Down

0 comments on commit a89a5a1

Please sign in to comment.