use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class MemoryUserRepositoryTest method testSaveUserWithBadArgs.
@DontRepeat
@Test
public void testSaveUserWithBadArgs() {
assertThrows(() -> instance.saveUser(null)).isInstanceOf(InvalidArgumentException.class);
assertThrows(() -> instance.saveUser(new User())).isInstanceOf(InvalidArgumentException.class);
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class MemoryUserRepositoryTest method testSaveUser.
@Test
public void testSaveUser() throws Exception {
instance.saveUser(user);
User result = instance.getUser(userId);
assertThat(result, is(user));
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class MemoryInboxRepositoryTest method testSaveMessageForUserWithBadArguments.
@DontRepeat
public void testSaveMessageForUserWithBadArguments() throws Exception {
assertThrows(() -> instance.saveMessageForUser(null, message)).isInstanceOf(InvalidArgumentException.class);
assertThrows(() -> instance.saveMessageForUser(user, null)).isInstanceOf(InvalidArgumentException.class);
assertThrows(() -> instance.saveMessageForUser(new User(), message)).isInstanceOf(InvalidArgumentException.class);
assertThrows(() -> instance.saveMessageForUser(user, new Message())).isInstanceOf(InvalidArgumentException.class);
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class MemoryOrganizationRepository method getOrganizationOwners.
@Override
public List<User> getOrganizationOwners(String organizationId) throws TException {
checkOrgId(organizationId);
Organization org = getOrganization(organizationId);
return Sets.copyOf(org.owners).stream().map(id -> new User().setUserId(id)).collect(toList());
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class CassandraActivityRepositoryTest method testSaveEventWithBadArgs.
@Test
public void testSaveEventWithBadArgs() throws Exception {
assertThrows(() -> instance.saveEvent(null, user)).isInstanceOf(InvalidArgumentException.class);
assertThrows(() -> instance.saveEvent(event, null)).isInstanceOf(InvalidArgumentException.class);
User userMissingId = new User();
assertThrows(() -> instance.saveEvent(event, userMissingId)).isInstanceOf(InvalidArgumentException.class);
Event eventMissingId = new Event(event);
eventMissingId.unsetEventId();
assertThrows(() -> instance.saveEvent(eventMissingId, user)).isInstanceOf(InvalidArgumentException.class);
User userWithBadId = new User(user).setUserId(badId);
assertThrows(() -> instance.saveEvent(event, userWithBadId)).isInstanceOf(InvalidArgumentException.class);
Event eventWithBadId = new Event(event).setEventId(badId);
assertThrows(() -> instance.saveEvent(eventWithBadId, user)).isInstanceOf(InvalidArgumentException.class);
}
Aggregations