@@ -26,6 +26,7 @@ public void TestUserUpdate() throws Exception {
2626 final long now = System .currentTimeMillis () / 1000 ;
2727 final User user = new User ()
2828 .setEmail ("wash@serenity.io" )
29+ .setId ("54321" )
2930 .setUserId ("22" )
3031 .setRemoteCreatedAt (now )
3132 .setName ("Wash" )
@@ -36,6 +37,7 @@ public void TestUserUpdate() throws Exception {
3637
3738 final User .UserUpdate userUpdate = User .UserUpdate .buildFrom (user );
3839
40+ assertEquals ("54321" , userUpdate .getId ());
3941 assertEquals ("wash@serenity.io" , userUpdate .getEmail ());
4042 assertEquals ("22" , userUpdate .getUserId ());
4143 assertEquals (now , userUpdate .getRemoteCreatedAt ());
@@ -46,6 +48,20 @@ public void TestUserUpdate() throws Exception {
4648 assertEquals ("user-agent" , userUpdate .getLastSeenUserAgent ());
4749 }
4850
51+ @ Test
52+ public void TestUserIncludesId () throws Exception {
53+ final User user = new User ();
54+ user .setEmail ("a@b.com" );
55+ user .setUserId ("1" );
56+ user .setId ("5432" );
57+ final String json = mapper .writeValueAsString (user );
58+ final Map map = mapper .readValue (json , Map .class );
59+ assertTrue (map .size () == 3 );
60+ assertTrue (map .containsKey ("email" ));
61+ assertTrue (map .containsKey ("user_id" ));
62+ assertTrue (map .containsKey ("id" ));
63+ }
64+
4965 @ Test
5066 public void TestUserSerdesNullAndNotEmpty () throws Exception {
5167 final User user = new User ();
0 commit comments