This repository was archived by the owner on Jan 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +52
-1
lines changed
src/test/java/com/fasterxml/jackson/datatype/guava/failing Expand file tree Collapse file tree 2 files changed +52
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ Guava (http://code.google.com/p/guava-libraries/) types (currently mostly just c
29
29
</contributors >
30
30
31
31
<properties >
32
- <version .jackson>2.5.2 </version .jackson>
32
+ <version .jackson>2.5.3-SNAPSHOT </version .jackson>
33
33
34
34
<!-- Generate PackageVersion.java into this directory. -->
35
35
<packageVersion .dir>com/fasterxml/jackson/datatype/guava</packageVersion .dir>
@@ -89,6 +89,15 @@ com.fasterxml.jackson.databind.util
89
89
</execution >
90
90
</executions >
91
91
</plugin >
92
+ <plugin >
93
+ <groupId >org.apache.maven.plugins</groupId >
94
+ <artifactId >maven-surefire-plugin</artifactId >
95
+ <configuration >
96
+ <excludes >
97
+ <exclude >com/fasterxml/jackson/**/failing/*.java</exclude >
98
+ </excludes >
99
+ </configuration >
100
+ </plugin >
92
101
</plugins >
93
102
</build >
94
103
</project >
Original file line number Diff line number Diff line change
1
+ package com .fasterxml .jackson .datatype .guava .failing ;
2
+
3
+ import com .fasterxml .jackson .annotation .*;
4
+
5
+ import com .fasterxml .jackson .databind .*;
6
+
7
+ import com .fasterxml .jackson .datatype .guava .ModuleTestBase ;
8
+
9
+ import com .google .common .base .Optional ;
10
+
11
+ /**
12
+ * Unit test for #64.
13
+ */
14
+ public class OptionalUnwrappedTest extends ModuleTestBase
15
+ {
16
+ static class Child {
17
+ public String name = "Bob" ;
18
+ }
19
+
20
+ static class Parent {
21
+ private Child child = new Child ();
22
+
23
+ @ JsonUnwrapped
24
+ public Child getChild () { return child ; }
25
+ }
26
+
27
+ static class OptionalParent {
28
+ @ JsonUnwrapped
29
+ public Optional <Child > child = Optional .of (new Child ());
30
+ }
31
+
32
+ private final ObjectMapper MAPPER = mapperWithModule ();
33
+
34
+ public void testUntyped () throws Exception
35
+ {
36
+ ObjectWriter w = MAPPER .writerWithDefaultPrettyPrinter ();
37
+ // String jsonExp = w.writeValueAsString(new Parent());
38
+ String jsonExp = aposToQuotes ("{\n 'name' : 'Bob'\n }" );
39
+ String jsonAct = w .writeValueAsString (new OptionalParent ());
40
+ assertEquals (jsonExp , jsonAct );
41
+ }
42
+ }
You can’t perform that action at this time.
0 commit comments