use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class MemoryApplicationRepositoryTest method testGetApplicationsOwnedBy.
@Test
public void testGetApplicationsOwnedBy() throws Exception {
User user = one(UserGenerators.users());
applications.forEach(app -> app.owners.add(user.userId));
saveApplications(applications);
List<Application> result = instance.getApplicationsOwnedBy(user.userId);
assertThat(containTheSameElements(applications, result), is(true));
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class MemoryUserRepositoryTest method testFindByGithubProfile.
@Test
public void testFindByGithubProfile() throws Exception {
instance.saveUser(user);
String profile = user.githubProfile;
User result = instance.findByGithubProfile(profile);
assertThat(result, is(user));
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class CassandraFollowerRepositoryIT method testGetApplicationFollowers.
@Test
public void testGetApplicationFollowers() throws Exception {
instance.saveFollowing(user, app);
List<User> followers = instance.getApplicationFollowers(appId);
assertThat(followers, notNullValue());
assertThat(followers, not(empty()));
assertThat(followers.size(), is(1));
User follower = Lists.oneOf(followers);
assertThat(follower.userId, is(userId));
assertThat(follower.firstName, is(user.firstName));
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class CassandraFollowerRepositoryTest method testGetApplicationFollowers.
@Test
public void testGetApplicationFollowers() throws Exception {
Map<String, Row> rows = Maps.create();
for (User follower : followers) {
Row mockRow = mock(Row.class);
when(userMapper.apply(mockRow)).thenReturn(follower);
rows.put(follower.userId, mockRow);
}
when(results.iterator()).thenReturn(rows.values().iterator());
Set<User> result = toSet(instance.getApplicationFollowers(appId));
assertThat(result, is(toSet(followers)));
}
use of tech.aroma.thrift.User in project aroma-data-operations by RedRoma.
the class CassandraUserRepositoryIT method testGetUser.
@Test
public void testGetUser() throws Exception {
instance.saveUser(user);
User result = instance.getUser(userId);
assertMostlyMatch(result, user);
}
Aggregations