Skip to content

Commit 4a92679

Browse files
Review comments addressed
1 parent 2c85bc3 commit 4a92679

File tree

5 files changed

+55
-42
lines changed

5 files changed

+55
-42
lines changed

src/main/java/com/siftscience/VerificationCheckResponse.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.siftscience;
22

33
import com.siftscience.model.VerificationCheckResponseBody;
4-
import com.siftscience.model.VerificationResponseBody;
54
import okhttp3.Response;
65

76
import java.io.IOException;

src/main/java/com/siftscience/model/Event.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public class Event {
1212

1313
@Expose @SerializedName("$browser") private Browser browser;
1414

15+
@Expose @SerializedName("$app") private App app;
16+
1517
public String getSessionId() {
1618
return sessionId;
1719
}
@@ -56,4 +58,13 @@ public Event setBrowser(Browser browser) {
5658
this.browser = browser;
5759
return this;
5860
}
61+
62+
public App getApp() {
63+
return app;
64+
}
65+
66+
public Event setApp(App app) {
67+
this.app = app;
68+
return this;
69+
}
5970
}

src/main/java/com/siftscience/model/VerificationResponseBody.java

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/main/java/com/siftscience/model/VerificationSendFieldSet.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public static VerificationSendFieldSet fromJson(String json) {
1313
@Expose @SerializedName("$send_to") private String sendTo;
1414
@Expose @SerializedName("$verification_type") private String verificationType;
1515
@Expose @SerializedName("$brand_name") private String brandName;
16+
@Expose @SerializedName("$site_country") private String siteCountry;
1617
@Expose @SerializedName("$language") private String language;
1718
@Expose @SerializedName("$event") private Event verificationEvent;
1819

@@ -52,6 +53,15 @@ public VerificationSendFieldSet setBrandName(String brandName) {
5253
return this;
5354
}
5455

56+
public String getSiteCountry() {
57+
return siteCountry;
58+
}
59+
60+
public VerificationSendFieldSet setSiteCountry(String siteCountry) {
61+
this.siteCountry = siteCountry;
62+
return this;
63+
}
64+
5565
public String getLanguage() {
5666
return language;
5767
}

src/test/java/com/siftscience/VerificationSendRequestTest.java

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.siftscience;
22

3+
import com.siftscience.model.App;
34
import com.siftscience.model.Browser;
45
import com.siftscience.model.Event;
56
import com.siftscience.model.VerificationSendFieldSet;
@@ -23,14 +24,27 @@ public void testVerification() throws Exception {
2324
" \"$send_to\": \"billy_jones_301@gmail.com\",\n" +
2425
" \"$verification_type\": \"$email\",\n" +
2526
" \"$brand_name\": \"brand\",\n" +
26-
" \"$language\": \"en\",\n" +
27+
" \"$site_country\": \"USA\",\n" +
28+
" \"$language\": \"English\",\n" +
2729
" \"$event\": {\n" +
2830
" \"$session_id\": \"gigtleqddo84l8cm15qe4il\",\n" +
2931
" \"$verified_event\": \"$login\",\n" +
3032
" \"$reason\": \"$automated_rule\",\n" +
3133
" \"$ip\": \"192.168.1.1\",\n" +
3234
" \"$browser\": {\n" +
33-
" \"$user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\"\n" +
35+
" \"$user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36\",\n" +
36+
" \"$content_language\": \"en-US\",\n" +
37+
" \"$accept_language\": \"en-GB\"\n" +
38+
" },\n" +
39+
" \"$app\": {\n" +
40+
" \"$os\": \"iOS\",\n" +
41+
" \"$os_version\": \"1.0.0\",\n" +
42+
" \"$device_manufacturer\": \"Apple\",\n" +
43+
" \"$device_model\": \"iphone 4.2\",\n" +
44+
" \"$device_unique_id\": \"A3D261E4-DE0A-470B-9E4A-720F3D3D22E6\",\n" +
45+
" \"$app_name\": \"my app\",\n" +
46+
" \"$app_version\": \"1.0\",\n" +
47+
" \"$client_language\": \"en-US\"\n" +
3448
" }\n" +
3549
" }\n" +
3650
"}";
@@ -44,8 +58,8 @@ public void testVerification() throws Exception {
4458
" \"sent_at\": 1566324368002,\n" +
4559
" \"segment_id\": \"4\",\n" +
4660
" \"segment_name\": \"Default template\",\n" +
47-
" \"brand_name\": \"brand\",\n" +
48-
" \"site_country\": \"USA\",\n" +
61+
" \"brand_name\": \"all\",\n" +
62+
" \"site_country\": \"IN\",\n" +
4963
" \"content_language\": \"English\"\n" +
5064
"}");
5165
server.enqueue(response);
@@ -62,7 +76,8 @@ public void testVerification() throws Exception {
6276
.setSendTo("billy_jones_301@gmail.com")
6377
.setVerificationType("$email")
6478
.setBrandName("brand")
65-
.setLanguage("en")
79+
.setSiteCountry("USA")
80+
.setLanguage("English")
6681
.setVerificationEvent(
6782
new Event()
6883
.setSessionId(sessionId)
@@ -71,8 +86,20 @@ public void testVerification() throws Exception {
7186
.setIp("192.168.1.1")
7287
.setBrowser(
7388
new Browser()
74-
.setUserAgent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36" +
75-
" (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36")
89+
.setUserAgent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) " +
90+
"Chrome/56.0.2924.87 Safari/537.36")
91+
.setContentLanguage("en-US")
92+
.setAcceptLanguage("en-GB")
93+
)
94+
.setApp(
95+
new App().setOperatingSystem("iOS")
96+
.setOperatingSystemVersion("1.0.0")
97+
.setDeviceManufacturer("Apple")
98+
.setDeviceModel("iphone 4.2")
99+
.setDeviceUniqueId("A3D261E4-DE0A-470B-9E4A-720F3D3D22E6")
100+
.setAppName("my app")
101+
.setAppVersion("1.0")
102+
.setClientLanguage("en-US")
76103
)
77104

78105
)

0 commit comments

Comments
 (0)