File tree Expand file tree Collapse file tree
src/test/java/com/auth0/json/mgmt/guardian Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,25 @@ public void shouldSerializeDataToBeSent() throws Exception {
2323 assertThat (serialized , JsonMatcher .hasEntry ("email" , "me@auth0.com" ));
2424 }
2525
26+ @ Test
27+ public void shouldSerializeDataToBeSentOnlyUserId () throws Exception {
28+ EnrollmentTicket ticket = new EnrollmentTicket ("1" );
29+
30+ String serialized = toJSON (ticket );
31+ assertThat (serialized , is (notNullValue ()));
32+ assertThat (serialized , JsonMatcher .hasEntry ("user_id" , "1" ));
33+ }
34+
35+ @ Test
36+ public void shouldSerializeDataToBeSentOnlyUserIdAndSendEmail () throws Exception {
37+ EnrollmentTicket ticket = new EnrollmentTicket ("1" , true );
38+
39+ String serialized = toJSON (ticket );
40+ assertThat (serialized , is (notNullValue ()));
41+ assertThat (serialized , JsonMatcher .hasEntry ("user_id" , "1" ));
42+ assertThat (serialized , JsonMatcher .hasEntry ("send_mail" , true ));
43+ }
44+
2645 @ Test
2746 public void shouldIncludeReadOnlyValuesOnDeserialize () throws Exception {
2847 EnrollmentTicket ticket = fromJSON (readOnlyJson , EnrollmentTicket .class );
You can’t perform that action at this time.
0 commit comments