Skip to content

Commit

Permalink
fix: test case assert for app install channel
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoweii committed Apr 10, 2024
1 parent 2ecc64e commit 9229b04
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public void testAddItem() throws Exception {
public void testAddGlobalAttribute() throws Exception {
long timestamp = System.currentTimeMillis();
ClickstreamAttribute globalAttribute = ClickstreamAttribute.builder()
.add("channel", "HUAWEI")
.add(ClickstreamAnalytics.Attr.APP_INSTALL_CHANNEL, "Amazon Store")
.add("level", 5.1)
.add("class", 6)
.add("timestamp", timestamp)
Expand All @@ -298,7 +298,8 @@ public void testAddGlobalAttribute() throws Exception {
JSONObject jsonObject = new JSONObject(eventString);
JSONObject attribute = jsonObject.getJSONObject("attributes");

Assert.assertEquals("HUAWEI", attribute.getString("channel"));
Assert.assertEquals("Amazon Store",
attribute.getString(ClickstreamAnalytics.Attr.APP_INSTALL_CHANNEL));
Assert.assertEquals(5.1, attribute.getDouble("level"), 0.01);
Assert.assertEquals(6, attribute.getInt("class"));
Assert.assertTrue(attribute.getBoolean("isOpenNotification"));
Expand Down Expand Up @@ -382,7 +383,8 @@ public void testDeleteGlobalAttribute() throws Exception {
JSONObject jsonObject = new JSONObject(eventString);
JSONObject attribute = jsonObject.getJSONObject("attributes");

Assert.assertEquals("Amazon Store", attribute.getString("channel"));
Assert.assertEquals("Amazon Store",
attribute.getString(ClickstreamAnalytics.Attr.APP_INSTALL_CHANNEL));
Assert.assertFalse(attribute.has("level"));
Assert.assertTrue(attribute.getBoolean("isOpenNotification"));
}
Expand Down

0 comments on commit 9229b04

Please sign in to comment.