use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class MeasuredUserRepositoryTest method testGetUser.
@Test
public void testGetUser() throws Exception {
when(delegate.getUser(userId)).thenReturn(user);
User result = instance.getUser(userId);
assertThat(result, is(user));
verify(delegate).getUser(userId);
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class CassandraOrganizationRepositoryTest method testGetOrganizationMembers.
@Test
public void testGetOrganizationMembers() throws Exception {
Map<String, Row> rows = Maps.create();
for (User member : members) {
Row mockRow = mock(Row.class);
when(userMapper.apply(mockRow)).thenReturn(member);
rows.put(member.userId, mockRow);
}
when(results.iterator()).thenReturn(rows.values().iterator());
List<User> response = instance.getOrganizationMembers(orgId);
assertThat(Sets.toSet(response), is(Sets.toSet(members)));
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class CassandraUserRepositoryIT method testFindByGithubProfile.
@Test
public void testFindByGithubProfile() throws Exception {
instance.saveUser(user);
User result = instance.findByGithubProfile(user.githubProfile);
assertMostlyMatch(result, user);
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class CassandraUserRepositoryIT method testGetUserByEmail.
@Test
public void testGetUserByEmail() throws Exception {
instance.saveUser(user);
User result = instance.getUserByEmail(user.email);
assertMostlyMatch(result, user);
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class CassandraOrganizationRepositoryIT method testDeleteAllMembers.
@Test
public void testDeleteAllMembers() throws Exception {
saveMembers(members);
instance.deleteAllMembers(orgId);
for (User member : members) {
assertThat(instance.isMemberInOrganization(orgId, member.userId), is(false));
}
}
Aggregations