File tree Expand file tree Collapse file tree
main/java/com/maxmind/minfraud/response
test/java/com/maxmind/minfraud/response Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,6 +21,13 @@ public Email(
2121 this .firstSeen = firstSeen ;
2222 }
2323
24+ public Email (
25+ Boolean isFree ,
26+ Boolean isHighRisk
27+ ) {
28+ this (isFree ,isHighRisk ,null );
29+ }
30+
2431 public Email () {
2532 this (null , null , null );
2633 }
Original file line number Diff line number Diff line change 66import static org .junit .Assert .assertEquals ;
77import static org .junit .Assert .assertFalse ;
88import static org .junit .Assert .assertTrue ;
9+ import static org .junit .Assert .assertNull ;
910
1011public class EmailTest extends AbstractOutputTest {
1112
@@ -27,4 +28,22 @@ public void testEmail() throws Exception {
2728 assertTrue (email .isHighRisk ());
2829 assertEquals (email .getFirstSeen (),"2017-01-02" );
2930 }
31+
32+ @ Test
33+ public void testEmailWithoutFirstSeen () throws Exception {
34+ Email email = this .deserialize (
35+ Email .class ,
36+ JSON .std
37+ .composeString ()
38+ .startObject ()
39+ .put ("is_free" , false )
40+ .put ("is_high_risk" , true )
41+ .end ()
42+ .finish ()
43+ );
44+
45+ assertFalse (email .isFree ());
46+ assertTrue (email .isHighRisk ());
47+ assertNull (email .getFirstSeen ());
48+ }
3049}
You can’t perform that action at this time.
0 commit comments