-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously putProducts was storing an array instead of copying the array. With Segment specifically this also caused issues with serialization. ``` "properties": { "products": "[Lcom.segment.analytics.Properties$Product;@36db3d6" } ```
- Loading branch information
Showing
3 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
analytics-tests/src/test/java/com/segment/analytics/PropertiesTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.segment.analytics; | ||
|
||
import com.segment.analytics.Properties.Product; | ||
import org.junit.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class PropertiesTest { | ||
@Test public void products() { | ||
Product product = new Product("foo", "bar", 10); | ||
Properties properties = new Properties(); | ||
properties.putProducts(product); | ||
|
||
assertThat(properties.products()).containsExactly(product); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters