request.getToken()); } else { return service.getActivityEntries(userIds.iterator().next(), request.getGroup(), request.getAppId(), request.getFields(), options, optionalActivityIds, request.getToken()); return service.getActivityEntries(userIds, request.getGroup(), request.getAppId(),
request.getToken()); } else { return service.getActivityEntries(userIds.iterator().next(), request.getGroup(), request.getAppId(), request.getFields(), options, optionalActivityIds, request.getToken()); return service.getActivityEntries(userIds, request.getGroup(), request.getAppId(),
@Test public void testHandleGetPlural() throws Exception { String path = "/activitystreams/john.doe,jane.doe/@self/@app"; RestHandler operation = registry.getRestHandler(path, "GET"); List<ActivityEntry> entries = ImmutableList.of(); RestfulCollection<ActivityEntry> data = new RestfulCollection<ActivityEntry>(entries); Set<UserId> userIdSet = Sets.newLinkedHashSet(JOHN_DOE); userIdSet.add(new UserId(UserId.Type.userId, "jane.doe")); org.easymock.EasyMock.expect(service.getActivityEntries(eq(userIdSet), eq(new GroupId(GroupId.Type.self, null)), eq("appId"),eq(ImmutableSet.<String>of()), org.easymock.EasyMock.isA((CollectionOptions.class)), eq(token))).andReturn( Futures.immediateFuture(data)); replay(); assertEquals(data, operation.execute(Maps.<String, String[]>newHashMap(), null, token, converter).get()); verify(); reset(); }
private void assertHandleGetForGroup(GroupId.Type group) throws Exception { String path = "/activitystreams/john.doe/@" + group.toString(); RestHandler operation = registry.getRestHandler(path, "GET"); List<ActivityEntry> entries = ImmutableList.of(); RestfulCollection<ActivityEntry> data = new RestfulCollection<ActivityEntry>(entries); org.easymock.EasyMock.expect(service.getActivityEntries(eq(JOHN_DOE), eq(new GroupId(group, null)), (String)isNull(), eq(ImmutableSet.<String>of()), org.easymock.EasyMock.isA(CollectionOptions.class), eq(token))). andReturn(Futures.immediateFuture(data)); replay(); assertEquals(data, operation.execute(Maps.<String, String[]>newHashMap(), null, token, converter).get()); verify(); reset(); }
@Test public void testHandleGetPlural() throws Exception { String path = "/activitystreams/john.doe,jane.doe/@self/@app"; RestHandler operation = registry.getRestHandler(path, "GET"); List<ActivityEntry> entries = ImmutableList.of(); RestfulCollection<ActivityEntry> data = new RestfulCollection<ActivityEntry>(entries); Set<UserId> userIdSet = Sets.newLinkedHashSet(JOHN_DOE); userIdSet.add(new UserId(UserId.Type.userId, "jane.doe")); org.easymock.EasyMock.expect(service.getActivityEntries(eq(userIdSet), eq(new GroupId(GroupId.Type.self, null)), eq("appId"),eq(ImmutableSet.<String>of()), org.easymock.EasyMock.isA((CollectionOptions.class)), eq(token))).andReturn( Futures.immediateFuture(data)); replay(); assertEquals(data, operation.execute(Maps.<String, String[]>newHashMap(), null, token, converter).get()); verify(); reset(); }
private void assertHandleGetForGroup(GroupId.Type group) throws Exception { String path = "/activitystreams/john.doe/@" + group.toString(); RestHandler operation = registry.getRestHandler(path, "GET"); List<ActivityEntry> entries = ImmutableList.of(); RestfulCollection<ActivityEntry> data = new RestfulCollection<ActivityEntry>(entries); org.easymock.EasyMock.expect(service.getActivityEntries(eq(JOHN_DOE), eq(new GroupId(group, null)), (String)isNull(), eq(ImmutableSet.<String>of()), org.easymock.EasyMock.isA(CollectionOptions.class), eq(token))). andReturn(Futures.immediateFuture(data)); replay(); assertEquals(data, operation.execute(Maps.<String, String[]>newHashMap(), null, token, converter).get()); verify(); reset(); }