Skip to content

Commit

Permalink
Update DeserializeSpec.groovy
Browse files Browse the repository at this point in the history
  • Loading branch information
radovanradic committed Jul 25, 2023
1 parent 215495a commit 29d3df9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ class DeserializeSpec extends Specification {
def ctx = ApplicationContext.run()
def mapper = ctx.getBean(JsonMapper)

when:"Can deserialize with null parameters for @Nullable field"
when:"Can deserialize with null parameters for @Nullable field of java.lang.Object type"
def result = mapper.readValue('{"valid":"false","message":"Invalid Input"}', Argument.of(TestStatus))
then:
!result.valid
result.message == 'Invalid Input'
result.additionalData == null

when:"Deserialize with all parameters"
when:"Deserialize with all parameters provided and non null"
result = mapper.readValue('{"valid":"true","message":"In Progress","additionalData":["Step1 Passed", "Step2 InProgress"]}', Argument.of(TestStatus))
then:
result.valid
Expand Down

0 comments on commit 29d3df9

Please sign in to comment.