Skip to content

Commit 6b9a6d4

Browse files
committed
Add a test for #17
1 parent bfab9b5 commit 6b9a6d4

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.fasterxml.jackson.dataformat.smile;
2+
3+
import com.fasterxml.jackson.annotation.*;
4+
import com.fasterxml.jackson.databind.*;
5+
6+
public class ObjectIdTest extends SmileTestBase
7+
{
8+
@JsonIdentityInfo(generator = ObjectIdGenerators.UUIDGenerator.class, property = "@id")
9+
public static class D {
10+
public D next;
11+
}
12+
13+
// [Issue#19]
14+
public void testObjectIdAsUUID() throws Exception
15+
{
16+
ObjectMapper mapper = smileMapper();
17+
D d = new D();
18+
d.next = d;
19+
20+
mapper.enable(SerializationFeature.INDENT_OUTPUT);
21+
byte[] smile = mapper.writeValueAsBytes(d);
22+
23+
D de = mapper.readValue(smile, D.class);
24+
assertNotNull(de);
25+
assertSame(de, de.next);
26+
}
27+
}

0 commit comments

Comments
 (0)