@Test public void writeReviewFeatureUsedEventMinimumFields() throws Exception { final BVFeatureUsedEvent subject = stubData.getWriteReviewFeatureUsedSchema( stubData.getProductId(), stubData.getAdditionalParams()); final Map<String, Object> subjectMap = subject.toRaw(); checkMapContains(subjectMap, BVEventKeys.Event.CLASS, BVEventValues.BVEventClass.FEATURE.toString()); checkMapContains(subjectMap, BVEventKeys.Event.TYPE, BVEventValues.BVEventType.USED.toString()); checkMapContains(subjectMap, BVEventKeys.Event.SOURCE, BVEventValues.BVEventSource.NATIVE_MOBILE_SDK.toString()); checkMapContains(subjectMap, BVEventKeys.FeatureUsedEvent.PRODUCT_ID, stubData.getProductId()); checkMapContains(subjectMap, BVEventKeys.FeatureUsedEvent.BV_PRODUCT_TYPE, BVEventValues.BVProductType.CONVERSATIONS_REVIEWS.toString()); checkMapContains(subjectMap, BVEventKeys.FeatureUsedEvent.BV_FEATURE_NAME, BVEventValues.BVFeatureUsedEventType.WRITE_REVIEW.toString()); }
@Override public Map<String, Object> toRaw() { Map<String, Object> map = super.toRaw(); if (brand != null) { mapPutSafe(map, BVEventKeys.FeatureUsedEvent.BRAND, brand); } boolean isInteractionEvent = bvFeatureUsedEventType != BVEventValues.BVFeatureUsedEventType.IN_VIEW; mapPutSafe(map, BVEventKeys.FeatureUsedEvent.INTERACTION, isInteractionEvent); mapPutSafe(map, BVEventKeys.FeatureUsedEvent.PRODUCT_ID, productId); mapPutSafe(map, BVEventKeys.FeatureUsedEvent.BV_PRODUCT_TYPE, bvProductType.toString()); mapPutSafe(map, BVEventKeys.FeatureUsedEvent.BV_FEATURE_NAME, bvFeatureUsedEventType.toString()); return map; }
BVFeatureUsedEvent extends BVMobileAnalyticsEvent { @Override public Map<String, Object> toRaw() { Map<String, Object> map = super.toRaw(); if (brand != null) { mapPutSafe(map, BVEventKeys.FeatureUsedEvent.BRAND, brand); } boolean isInteractionEvent = bvFeatureUsedEventType != BVEventValues.BVFeatureUsedEventType.IN_VIEW; mapPutSafe(map, BVEventKeys.FeatureUsedEvent.INTERACTION, isInteractionEvent); mapPutSafe(map, BVEventKeys.FeatureUsedEvent.PRODUCT_ID, productId); mapPutSafe(map, BVEventKeys.FeatureUsedEvent.BV_PRODUCT_TYPE, bvProductType.toString()); mapPutSafe(map, BVEventKeys.FeatureUsedEvent.BV_FEATURE_NAME, bvFeatureUsedEventType.toString()); return map; } }
BVFeatureUsedEvent extends BVMobileAnalyticsEvent { @Override public Map<String, Object> toRaw() { Map<String, Object> map = super.toRaw(); if (brand != null) { mapPutSafe(map, BVEventKeys.FeatureUsedEvent.BRAND, brand); } boolean isInteractionEvent = bvFeatureUsedEventType != BVEventValues.BVFeatureUsedEventType.IN_VIEW; mapPutSafe(map, BVEventKeys.FeatureUsedEvent.INTERACTION, isInteractionEvent); mapPutSafe(map, BVEventKeys.FeatureUsedEvent.PRODUCT_ID, productId); mapPutSafe(map, BVEventKeys.FeatureUsedEvent.BV_PRODUCT_TYPE, bvProductType.toString()); mapPutSafe(map, BVEventKeys.FeatureUsedEvent.BV_FEATURE_NAME, bvFeatureUsedEventType.toString()); return map; } BVFeatureUsedEvent(String productId,
                            @NonNull BVEventValues.BVProductType bvProductType,
                            @NonNull BVEventValues.BVFeatureUsedEventType bvFeatureUsedEventType,
                            @Nullable String brand); }
BVFeatureUsedEvent extends BVMobileAnalyticsEvent { @Override public Map<String, Object> toRaw() { Map<String, Object> map = super.toRaw(); if (brand != null) { mapPutSafe(map, BVEventKeys.FeatureUsedEvent.BRAND, brand); } boolean isInteractionEvent = bvFeatureUsedEventType != BVEventValues.BVFeatureUsedEventType.IN_VIEW; mapPutSafe(map, BVEventKeys.FeatureUsedEvent.INTERACTION, isInteractionEvent); mapPutSafe(map, BVEventKeys.FeatureUsedEvent.PRODUCT_ID, productId); mapPutSafe(map, BVEventKeys.FeatureUsedEvent.BV_PRODUCT_TYPE, bvProductType.toString()); mapPutSafe(map, BVEventKeys.FeatureUsedEvent.BV_FEATURE_NAME, bvFeatureUsedEventType.toString()); return map; } BVFeatureUsedEvent(String productId,
                            @NonNull BVEventValues.BVProductType bvProductType,
                            @NonNull BVEventValues.BVFeatureUsedEventType bvFeatureUsedEventType,
                            @Nullable String brand); @Override Map<String, Object> toRaw(); }
BVFeatureUsedEvent extends BVMobileAnalyticsEvent { @Override public Map<String, Object> toRaw() { Map<String, Object> map = super.toRaw(); if (brand != null) { mapPutSafe(map, BVEventKeys.FeatureUsedEvent.BRAND, brand); } boolean isInteractionEvent = bvFeatureUsedEventType != BVEventValues.BVFeatureUsedEventType.IN_VIEW; mapPutSafe(map, BVEventKeys.FeatureUsedEvent.INTERACTION, isInteractionEvent); mapPutSafe(map, BVEventKeys.FeatureUsedEvent.PRODUCT_ID, productId); mapPutSafe(map, BVEventKeys.FeatureUsedEvent.BV_PRODUCT_TYPE, bvProductType.toString()); mapPutSafe(map, BVEventKeys.FeatureUsedEvent.BV_FEATURE_NAME, bvFeatureUsedEventType.toString()); return map; } BVFeatureUsedEvent(String productId,
                            @NonNull BVEventValues.BVProductType bvProductType,
                            @NonNull BVEventValues.BVFeatureUsedEventType bvFeatureUsedEventType,
                            @Nullable String brand); @Override Map<String, Object> toRaw();  }