use of tech.sirwellington.alchemy.test.junit.runners.DontRepeat in project aroma-data-operations by RedRoma.
the class CassandraInboxRepositoryTest method testSaveMessageForUserWithBadArgs.
@DontRepeat
@Test
public void testSaveMessageForUserWithBadArgs() throws Exception {
User userWithBadId = new User(user).setUserId(badId);
assertThrows(() -> instance.saveMessageForUser(userWithBadId, message, lifetime)).isInstanceOf(InvalidArgumentException.class);
Message messageWithBadId = new Message(message).setMessageId(badId);
assertThrows(() -> instance.saveMessageForUser(user, messageWithBadId, lifetime)).isInstanceOf(InvalidArgumentException.class);
Message messageWithBadAppId = new Message(message).setApplicationId(badId);
assertThrows(() -> instance.saveMessageForUser(user, messageWithBadAppId, lifetime)).isInstanceOf(InvalidArgumentException.class);
}
use of tech.sirwellington.alchemy.test.junit.runners.DontRepeat in project aroma-data-operations by RedRoma.
the class CassandraMediaRepositoryTest method testSaveMediaWithBadArgs.
@DontRepeat
@Test
public void testSaveMediaWithBadArgs() throws Exception {
// Missing media id
assertThrows(() -> instance.saveMedia("", image)).isInstanceOf(InvalidArgumentException.class);
// Missing Image
assertThrows(() -> instance.saveMedia(mediaId, null)).isInstanceOf(InvalidArgumentException.class);
// bad Id
assertThrows(() -> instance.saveMedia(badId, image)).isInstanceOf(InvalidArgumentException.class);
// Empty Image
Image emptyImage = new Image();
assertThrows(() -> instance.saveMedia(badId, emptyImage)).isInstanceOf(InvalidArgumentException.class);
}
use of tech.sirwellington.alchemy.test.junit.runners.DontRepeat 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.sirwellington.alchemy.test.junit.runners.DontRepeat 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.sirwellington.alchemy.test.junit.runners.DontRepeat in project aroma-data-operations by RedRoma.
the class MeasuredUserRepositoryTest method testDeleteUserWhenThrows.
@DontRepeat
@Test
public void testDeleteUserWhenThrows() throws Exception {
doThrow(new UserDoesNotExistException()).when(delegate).deleteUser(userId);
assertThrows(() -> instance.deleteUser(userId)).isInstanceOf(UserDoesNotExistException.class);
verify(delegate).deleteUser(userId);
}
Aggregations