use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class CassandraActivityRepository method saveEvent.
@Override
public void saveEvent(Event event, User forUser, LengthOfTime lifetime) throws TException {
checkEvent(event);
checkUser(forUser);
checkLifetime(lifetime);
User user = forUser;
Statement insertStatement = createStatementToSaveEventForUser(event, user, lifetime);
tryToExecute(insertStatement, "saveEvent");
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class MemoryInboxRepositoryTest method setUp.
@Before
public void setUp() {
user = new User().setUserId(userId).setName(nameOfUser);
message.messageId = messageId;
message.applicationId = appId;
instance = new MemoryInboxRepository();
messages = messages.stream().map(m -> m.setApplicationId(appId)).map(m -> m.setMessageId(one(uuids))).collect(toList());
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class MemoryActivityRepositoryTest method testDeleteAllEventsForWithBadArgs.
@Test
public void testDeleteAllEventsForWithBadArgs() throws Exception {
assertThrows(() -> instance.deleteAllEventsFor(null)).isInstanceOf(InvalidArgumentException.class);
assertThrows(() -> instance.deleteAllEventsFor(new User())).isInstanceOf(InvalidArgumentException.class);
assertThrows(() -> instance.deleteAllEventsFor(new User().setUserId(badId))).isInstanceOf(InvalidArgumentException.class);
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class MemoryApplicationRepositoryTest method testGetApplicationOwnedByWhenNoneOwned.
@DontRepeat
@Test
public void testGetApplicationOwnedByWhenNoneOwned() throws Exception {
User user = one(pojos(User.class));
List<Application> result = instance.getApplicationsOwnedBy(user.userId);
assertThat(result, notNullValue());
assertThat(result, is(empty()));
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class MemoryUserRepositoryTest method testGetUserByEmail.
@Test
public void testGetUserByEmail() throws Exception {
instance.saveUser(user);
String email = user.email;
User result = instance.getUserByEmail(email);
assertThat(result, is(user));
}
Aggregations