File tree Expand file tree Collapse file tree
main/java/com/exceptionless/exceptionlessclient/utils
test/java/com/exceptionless/exceptionlessclient/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ public final class Utils {
1717 JSON_MAPPER = new ObjectMapper ();
1818 JSON_MAPPER .registerModule (new JavaTimeModule ());
1919 JSON_MAPPER .disable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS );
20+ JSON_MAPPER .disable (SerializationFeature .FAIL_ON_EMPTY_BEANS );
2021 }
2122
2223 private static final Logger LOG = LoggerFactory .getLogger (Utils .class );
Original file line number Diff line number Diff line change 11package com .exceptionless .exceptionlessclient .utils ;
22
3+ import com .fasterxml .jackson .core .JsonProcessingException ;
34import org .junit .jupiter .api .Test ;
45
56import java .net .URI ;
@@ -80,4 +81,11 @@ public void itCanMatchAValueToAPattern() {
8081 assertThat (Utils .match ("abc" , "def" )).isFalse ();
8182 assertThat (Utils .match ("ABC" , "abc" )).isTrue ();
8283 }
84+
85+ @ Test
86+ public void itCanSerializeEmptyBeans () throws JsonProcessingException {
87+ class EmptyBean {}
88+
89+ assertThat (Utils .JSON_MAPPER .writeValueAsString (new EmptyBean ())).isEqualTo ("{}" );
90+ }
8391}
You can’t perform that action at this time.
0 commit comments