This repository was archived by the owner on Jun 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed
itests/src/test/java/com/elasticinbox/itests
common/src/test/java/com/elasticinbox/common/utils
core/src/main/java/com/elasticinbox/core/model Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -341,6 +341,7 @@ public void messageAddListViewDeletePurgeTest() throws IOException
341341 body (messageId + ".from.address" , hasItems (containsString ("@" ))).
342342 body (messageId + ".to.address" , hasItems (containsString ("@" ))).
343343 body (messageId + ".subject" , is (notNullValue ())).
344+ body (messageId , not (hasKey ("bcc" ))).
344345 when ().
345346 get (REST_PATH + "/mailbox/label/{labelId}?metadata=true&count=2&start={messageId}" );
346347
Original file line number Diff line number Diff line change 1+ package com .elasticinbox .common .utils ;
2+
3+ import static org .junit .Assert .*;
4+
5+ import java .util .HashMap ;
6+ import java .util .Map ;
7+
8+ import org .junit .Test ;
9+
10+ public class JSONUtilsTest
11+ {
12+ @ Test
13+ public void testNullValueSerialization ()
14+ {
15+ Map <String , String > testMap = new HashMap <String , String >();
16+ testMap .put ("key1" , "val1" );
17+ testMap .put ("key2" , null );
18+
19+ byte [] bytes = JSONUtils .fromObject (testMap );
20+ String result = new String (bytes );
21+
22+ assertFalse (result .contains ("null" ));
23+ }
24+
25+ }
Original file line number Diff line number Diff line change 3737import java .util .Set ;
3838
3939import com .fasterxml .jackson .annotation .JsonIgnore ;
40+ import com .fasterxml .jackson .annotation .JsonInclude ;
41+ import com .fasterxml .jackson .annotation .JsonInclude .Include ;
4042
4143import com .elasticinbox .core .blob .BlobURI ;
4244
5254 * @see {@link MimePart}
5355 * @see <a href="http://tools.ietf.org/html/rfc3501#section-6.4.5">RFC3501</a>
5456 */
57+ @ JsonInclude (Include .NON_NULL )
5558public class Message
5659{
5760 private AddressList from ;
You can’t perform that action at this time.
0 commit comments