@Test public void shouldNotContainCategoryIdWhenNull() { BVPageViewEvent event = new BVPageViewEvent( stubData.getProductId(), stubData.getBvProductTypeReviews(), null); event.setBvMobileParams(stubData.getBvMobileParams()); Map<String, Object> map = event.toRaw(); assertFalse(map.containsKey(BVEventKeys.PageViewEvent.CATEGORY_ID)); }
@Override public Map<String, Object> toRaw() { Map<String, Object> map = super.toRaw(); mapPutSafe(map, PRODUCT_ID, productId); if (categoryId != null) { mapPutSafe(map, CATEGORY_ID, categoryId); } mapPutSafe(map, BV_PRODUCT_TYPE, bvProductType.toString()); return map; }
BVPageViewEvent extends BVMobileAnalyticsEvent { @Override public Map<String, Object> toRaw() { Map<String, Object> map = super.toRaw(); mapPutSafe(map, PRODUCT_ID, productId); if (categoryId != null) { mapPutSafe(map, CATEGORY_ID, categoryId); } mapPutSafe(map, BV_PRODUCT_TYPE, bvProductType.toString()); return map; } }
BVPageViewEvent extends BVMobileAnalyticsEvent { @Override public Map<String, Object> toRaw() { Map<String, Object> map = super.toRaw(); mapPutSafe(map, PRODUCT_ID, productId); if (categoryId != null) { mapPutSafe(map, CATEGORY_ID, categoryId); } mapPutSafe(map, BV_PRODUCT_TYPE, bvProductType.toString()); return map; } BVPageViewEvent(@NonNull String productId,
                         @NonNull BVEventValues.BVProductType bvProductType,
                         @Nullable String categoryId); }
BVPageViewEvent extends BVMobileAnalyticsEvent { @Override public Map<String, Object> toRaw() { Map<String, Object> map = super.toRaw(); mapPutSafe(map, PRODUCT_ID, productId); if (categoryId != null) { mapPutSafe(map, CATEGORY_ID, categoryId); } mapPutSafe(map, BV_PRODUCT_TYPE, bvProductType.toString()); return map; } BVPageViewEvent(@NonNull String productId,
                         @NonNull BVEventValues.BVProductType bvProductType,
                         @Nullable String categoryId); @Override Map<String, Object> toRaw(); }
BVPageViewEvent extends BVMobileAnalyticsEvent { @Override public Map<String, Object> toRaw() { Map<String, Object> map = super.toRaw(); mapPutSafe(map, PRODUCT_ID, productId); if (categoryId != null) { mapPutSafe(map, CATEGORY_ID, categoryId); } mapPutSafe(map, BV_PRODUCT_TYPE, bvProductType.toString()); return map; } BVPageViewEvent(@NonNull String productId,
                         @NonNull BVEventValues.BVProductType bvProductType,
                         @Nullable String categoryId); @Override Map<String, Object> toRaw();  }