本文整理了Java中com.segment.analytics.Analytics.alias()
方法的一些代码示例,展示了Analytics.alias()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Analytics.alias()
方法的具体详情如下:
包路径:com.segment.analytics.Analytics
类名称:Analytics
方法名:alias
暂无
代码示例来源:origin: segmentio/analytics-android
/** @see #alias(String, Options) */
public void alias(@NonNull String newId) {
alias(newId, null);
}
代码示例来源:origin: segmentio/analytics-android
@Test
public void invalidAlias() {
try {
analytics.alias(null);
fail("null new id should throw error");
} catch (IllegalArgumentException expected) {
assertThat(expected).hasMessage("newId must not be null or empty.");
}
}
代码示例来源:origin: segmentio/analytics-android
@Test
public void alias() {
String anonymousId = traits.anonymousId();
analytics.alias("foo");
ArgumentCaptor<AliasPayload> payloadArgumentCaptor =
ArgumentCaptor.forClass(AliasPayload.class);
verify(integration).alias(payloadArgumentCaptor.capture());
assertThat(payloadArgumentCaptor.getValue())
.containsEntry("previousId", anonymousId)
.containsEntry("userId", "foo");
}
代码示例来源:origin: segmentio/analytics-android
@Test
public void optionsDisableIntegrations() {
analytics.screen("foo", "bar", null, new Options().setIntegration("test", false));
analytics.track("foo", null, new Options().setIntegration("test", false));
analytics.group("foo", null, new Options().setIntegration("test", false));
analytics.identify("foo", null, new Options().setIntegration("test", false));
analytics.alias("foo", new Options().setIntegration("test", false));
analytics.screen(
"foo", "bar", null, new Options().setIntegration(Options.ALL_INTEGRATIONS_KEY, false));
analytics.track("foo", null, new Options().setIntegration(Options.ALL_INTEGRATIONS_KEY, false));
analytics.group("foo", null, new Options().setIntegration(Options.ALL_INTEGRATIONS_KEY, false));
analytics.identify(
"foo", null, new Options().setIntegration(Options.ALL_INTEGRATIONS_KEY, false));
analytics.alias("foo", new Options().setIntegration(Options.ALL_INTEGRATIONS_KEY, false));
verifyNoMoreInteractions(integration);
}
内容来源于网络,如有侵权,请联系作者删除!