我在测试用例中遇到了异常
com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot
deserialize value of type java.util.UUID from String "361236": UUID has to be
represented by standard 36-char representation at [Source: (String)"{
"flowId" : "54947df8-0e9e-4471-a2f9-9af509fb5889",
"rowId" : 361236
}
我正在尝试使用杰克逊对象映射器将我的UUID值从Json映射到Java类,因此我使用了"flowId" : "${UUID.fromString("54947df8-0e9e-4471-a2f9-9af509fb5889")}"
,
我的测试用例代码如下:
`@Test
fun `test to get onboardGql Converter`() {
val input="""
{
"flowId" : "${UUID.fromString("54947df8-0e9e-4471-a2f9-
9af509fb5889")}",
"rowId" : 361236
}"""
val MyClass=jacksonObjectMapper().readValue<MyClass>(input);
}