use of tech.aroma.thrift.Application in project aroma-data-operations by RedRoma.
the class CassandraFollowerRepositoryTest method testSaveFollowingWithBadArgs.
@Test
public void testSaveFollowingWithBadArgs() throws Exception {
User emptyUser = new User();
Application emptyApp = new Application();
assertThrows(() -> instance.saveFollowing(emptyUser, app)).isInstanceOf(InvalidArgumentException.class);
assertThrows(() -> instance.saveFollowing(user, emptyApp)).isInstanceOf(InvalidArgumentException.class);
User userWithBadId = user.setUserId(one(alphabeticString()));
Application appWithBadId = app.setApplicationId(one(alphabeticString()));
assertThrows(() -> instance.saveFollowing(userWithBadId, app)).isInstanceOf(InvalidArgumentException.class);
assertThrows(() -> instance.saveFollowing(user, appWithBadId)).isInstanceOf(InvalidArgumentException.class);
}
use of tech.aroma.thrift.Application in project aroma-data-operations by RedRoma.
the class CassandraFollowerRepositoryTest method testGetApplicationsFollowedBy.
@Test
public void testGetApplicationsFollowedBy() throws Exception {
Map<String, Row> rows = Maps.create();
for (Application app : apps) {
Row mockRow = mock(Row.class);
when(applicationMapper.apply(mockRow)).thenReturn(app);
rows.put(app.applicationId, mockRow);
}
when(results.iterator()).thenReturn(rows.values().iterator());
Set<Application> result = toSet(instance.getApplicationsFollowedBy(userId));
assertThat(result, is(toSet(apps)));
}
use of tech.aroma.thrift.Application 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.Application in project aroma-data-operations by RedRoma.
the class MemoryApplicationRepositoryTest method testSaveApplicationWithBadArguments.
@DontRepeat
@Test
public void testSaveApplicationWithBadArguments() throws Exception {
assertThrows(() -> instance.saveApplication(null)).isInstanceOf(InvalidArgumentException.class);
Application emptyApplication = new Application();
assertThrows(() -> instance.saveApplication(emptyApplication)).isInstanceOf(InvalidArgumentException.class);
}
use of tech.aroma.thrift.Application in project aroma-data-operations by RedRoma.
the class MemoryApplicationRepositoryTest method testSaveApplication.
@Test
public void testSaveApplication() throws Exception {
instance.saveApplication(application);
Application result = instance.getById(applicationId);
assertThat(result, is(application));
}
Aggregations