本文整理了Java中com.segment.analytics.Analytics.group()
方法的一些代码示例,展示了Analytics.group()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Analytics.group()
方法的具体详情如下:
包路径:com.segment.analytics.Analytics
类名称:Analytics
方法名:group
暂无
代码示例来源:origin: segmentio/analytics-android
/** @see #group(String, Traits, Options) */
public void group(@NonNull String groupId) {
group(groupId, null, null);
}
代码示例来源:origin: segmentio/analytics-android
/** @see #group(String, Traits, Options) */
public void group(@NonNull String groupId, @Nullable Traits traits) {
group(groupId, traits, null);
}
代码示例来源:origin: segmentio/analytics-android
@Test
public void invalidGroup() {
try {
analytics.group(null);
fail("null groupId should throw exception");
} catch (IllegalArgumentException expected) {
assertThat(expected).hasMessage("groupId must not be null or empty.");
}
try {
analytics.group("");
fail("empty groupId and name should throw exception");
} catch (IllegalArgumentException expected) {
assertThat(expected).hasMessage("groupId must not be null or empty.");
}
}
代码示例来源:origin: segmentio/analytics-android
@Test
public void group() {
final String uuid = UUID.randomUUID().toString();
analytics.group("segment", new Traits().putValue("id", uuid));
analytics.flush();
assertMessageReceivedByWebhook(uuid);
}
代码示例来源:origin: segmentio/analytics-android
@Test
public void identify() throws Exception {
final String uuid = UUID.randomUUID().toString();
analytics.group("prateek", new Traits().putValue("id", uuid));
analytics.flush();
assertMessageReceivedByWebhook(uuid);
}
代码示例来源:origin: segmentio/analytics-android
@Test
public void group() {
analytics.group("segment", new Traits().putEmployees(42), null);
verify(integration)
.group(
argThat(
new NoDescriptionMatcher<GroupPayload>() {
@Override
protected boolean matchesSafely(GroupPayload item) {
return item.groupId().equals("segment") && item.traits().employees() == 42;
}
}));
}
代码示例来源: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);
}
内容来源于网络,如有侵权,请联系作者删除!