File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
main/java/com/exceptionless/exceptionlessclient/utils
test/java/com/exceptionless/exceptionlessclient/utils Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ public final class Utils {
17
17
JSON_MAPPER = new ObjectMapper ();
18
18
JSON_MAPPER .registerModule (new JavaTimeModule ());
19
19
JSON_MAPPER .disable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS );
20
+ JSON_MAPPER .disable (SerializationFeature .FAIL_ON_EMPTY_BEANS );
20
21
}
21
22
22
23
private static final Logger LOG = LoggerFactory .getLogger (Utils .class );
Original file line number Diff line number Diff line change 1
1
package com .exceptionless .exceptionlessclient .utils ;
2
2
3
+ import com .fasterxml .jackson .core .JsonProcessingException ;
3
4
import org .junit .jupiter .api .Test ;
4
5
5
6
import java .net .URI ;
@@ -80,4 +81,11 @@ public void itCanMatchAValueToAPattern() {
80
81
assertThat (Utils .match ("abc" , "def" )).isFalse ();
81
82
assertThat (Utils .match ("ABC" , "abc" )).isTrue ();
82
83
}
84
+
85
+ @ Test
86
+ public void itCanSerializeEmptyBeans () throws JsonProcessingException {
87
+ class EmptyBean {}
88
+
89
+ assertThat (Utils .JSON_MAPPER .writeValueAsString (new EmptyBean ())).isEqualTo ("{}" );
90
+ }
83
91
}
You can’t perform that action at this time.
0 commit comments