use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class CassandraActivityRepositoryTest method testGetAllEventsForWithBadArgs.
@Test
public void testGetAllEventsForWithBadArgs() throws Exception {
assertThrows(() -> instance.getAllEventsFor(null)).isInstanceOf(InvalidArgumentException.class);
assertThrows(() -> instance.getAllEventsFor(new User())).isInstanceOf(InvalidArgumentException.class);
User userWithBadId = new User(user).setUserId(badId);
assertThrows(() -> instance.getAllEventsFor(userWithBadId)).isInstanceOf(InvalidArgumentException.class);
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class CassandraActivityRepositoryTest method testGetEventWithBadArgs.
@Test
public void testGetEventWithBadArgs() throws Exception {
assertThrows(() -> instance.getEvent("", user)).isInstanceOf(InvalidArgumentException.class);
assertThrows(() -> instance.getEvent(badId, user)).isInstanceOf(InvalidArgumentException.class);
assertThrows(() -> instance.getEvent(eventId, null)).isInstanceOf(InvalidArgumentException.class);
assertThrows(() -> instance.getEvent(eventId, new User())).isInstanceOf(InvalidArgumentException.class);
User userWithBadId = new User(user).setUserId(badId);
assertThrows(() -> instance.getEvent(eventId, userWithBadId)).isInstanceOf(InvalidArgumentException.class);
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class MemoryActivityRepository method saveEvent.
@Override
public void saveEvent(Event event, User forUser, LengthOfTime lifetime) throws TException {
checkEvent(event);
checkUser(forUser);
checkLifetime(lifetime);
User user = forUser;
List<Event> eventsForUser = events.getOrDefault(user, Lists.create());
eventsForUser.add(event);
events.put(user, eventsForUser);
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class MemoryOrganizationRepositoryTest method testGetOrganizationOwners.
@Test
public void testGetOrganizationOwners() throws Exception {
instance.saveOrganization(org);
List<User> owners = instance.getOrganizationOwners(orgId);
for (User owner : owners) {
assertThat(owner.userId, isIn(org.owners));
}
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class MemoryFollowerRepositoryTest method testGetApplicationFollowers.
@Test
public void testGetApplicationFollowers() throws Exception {
for (User follower : this.followers) {
instance.saveFollowing(follower, application);
}
List<User> result = instance.getApplicationFollowers(applicationId);
assertThat(result, notNullValue());
assertThat(Sets.containTheSameElements(result, followers), is(true));
}
Aggregations