Skip to content

Commit ec87f8e

Browse files
committed
Add missing tests
1 parent fd08a03 commit ec87f8e

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

src/test/java/com/auth0/json/mgmt/guardian/EnrollmentTicketTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)