additional identify tests for
MODIFY
analytics/src/test/java/com/segment/analytics/AnalyticsTest.kt
analytics/src/test/java/com/segment/analytics/AnalyticsTest.kt
@@ -264,6 +264,23 @@ open class AnalyticsTest {
)
}
+ @Test
+ fun identifyNullTraits() {
+ analytics.identify("userId", null, null)
+
+ assertThat(traits.userId()).isEqualTo("userId")
+ assertThat(traits.username()).isNull()
+ }
+
+ @Test
+ fun identifySavesPreviousTraits() {
+ analytics.identify("userId", Traits().putUsername("username"), null)
+ analytics.identify("userId")
+
+ assertThat(traits.userId()).isEqualTo("userId")
+ assertThat(traits.username()).isEqualTo("username")
+ }
+
@Test
@Nullable
fun invalidGroup() {

additional identify tests for LIBMOBILE-49 (#730)