@Test
public void createNewActivityForJohnDoe() throws Exception {
// Create new activity
final String title = "hi mom!";
final String body = "and dad.";
Activity activity = SpiTestUtil.buildTestActivity("2", "john.doe", title, body);
this.activityServiceDb.createActivity(new UserId(Type.userId, "john.doe"), new GroupId(GroupId.Type.self, "@self"), "2", ACTIVITY_ALL_FIELDS, activity, SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);
// Check activity was created as expected
Future<RestfulCollection<Activity>> result = this.activityServiceDb.getActivities(SpiTestUtil.buildUserIds("john.doe"), new GroupId(GroupId.Type.self, "@self"), null, ACTIVITY_ALL_FIELDS, new CollectionOptions(), SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);
RestfulCollection<Activity> activityCollection = result.get();
assertEquals(2, activityCollection.getTotalResults());
assertEquals(0, activityCollection.getStartIndex());
activity = activityCollection.getEntry().get(1);
assertEquals(activity.getTitle(), title);
assertEquals(activity.getBody(), body);
}