Skip to content

Commit

Permalink
8.15.0 Version (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
junaidBazaarVoice authored Oct 25, 2023
1 parent 6ffaa54 commit b688cb1
Show file tree
Hide file tree
Showing 6 changed files with 596 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

# 8.15.0
## Add Product Level Attribution.

* Added Support for OriginalProductName to base review.

# 8.14.0
## Upgrade Gradle

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.bazaarvoice.bvsdkdemoandroid

import java.security.SecureRandom
import java.text.SimpleDateFormat
import java.util.*
import javax.crypto.Mac
Expand All @@ -12,6 +13,7 @@ import javax.crypto.spec.SecretKeySpec
internal object DemoUserTokenFactory {

var UAS:String? = null
private val secureRandom = SecureRandom()
@JvmStatic
@JvmName("generateUserToken")
internal fun generateUserToken(userEmail: String, userId: String, encodingKey: String): String {
Expand Down Expand Up @@ -49,11 +51,17 @@ internal object DemoUserTokenFactory {
if(UAS != null) {
return UAS!!
}
val mockEncodingKey = "mockencodingkey"
val mockEncodingKey = generateRandomKey().toHex();
val id = Date().time
val mockEmail = "bvtestuser$id@bv.com"
val mockUserId = "local-$id"
UAS = generateUserToken(mockEmail, mockUserId, mockEncodingKey)
return UAS!!
}

private fun generateRandomKey(): ByteArray {
val key = ByteArray(32)
secureRandom.nextBytes(key)
return key
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ public abstract class BaseReview extends IncludedContentBase.ProductIncludedCont
private Boolean isRecommended;
@SerializedName(value = "IsSyndicated", alternate = "isSyndicated")
private Boolean isSyndicated;
public String getOriginalProductName() {
return originalProductName;
}
@SerializedName(value = "OriginalProductName", alternate = "originalProductName")
private String originalProductName;
@SerializedName(value = "IsRatingsOnly", alternate = "isRatingsOnly")
private Boolean isRatingsOnly;
@SerializedName(value = "Rating", alternate = "rating")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,4 +852,14 @@ public void testQAStatsStatisticsResponse() throws Exception {
assertEquals(5, response.getResults().get(0).getProductStatistics().getQAStatistics().getTotalAnswerCount().intValue());

}

@Test
public void testReviewForOriginalProductName() throws Exception {

ReviewResponse response = parseJsonResourceFile("reviews_with_original_product_name.json", ReviewResponse.class, gson);
Review firstReview = response.getResults().get(0);

assertEquals("14K White Gold Diamond Teardrop Necklace", firstReview.getOriginalProductName());

}
}
Loading

0 comments on commit b688cb1

Please sign in to comment.