Search in sources :

Example 16 with DontRepeat

use of tech.sirwellington.alchemy.test.junit.runners.DontRepeat in project aroma-data-operations by RedRoma.

the class CassandraInboxRepositoryTest method testContainsMessageInInboxWithBadArgs.

@DontRepeat
@Test
public void testContainsMessageInInboxWithBadArgs() throws Exception {
    assertThrows(() -> instance.containsMessageInInbox(badId, message)).isInstanceOf(InvalidArgumentException.class);
    Message messageWithBadId = new Message(message).setMessageId(badId);
    assertThrows(() -> instance.containsMessageInInbox(userId, messageWithBadId)).isInstanceOf(InvalidArgumentException.class);
    Message messageWithBadAppId = new Message(message).setApplicationId(badId);
    assertThrows(() -> instance.containsMessageInInbox(userId, messageWithBadAppId)).isInstanceOf(InvalidArgumentException.class);
}
Also used : Message(tech.aroma.thrift.Message) Test(org.junit.Test) DontRepeat(tech.sirwellington.alchemy.test.junit.runners.DontRepeat)

Example 17 with DontRepeat

use of tech.sirwellington.alchemy.test.junit.runners.DontRepeat in project aroma-data-operations by RedRoma.

the class MemoryOrganizationRepositoryTest method testSaveOrgWithBadArgs.

@DontRepeat
@Test
public void testSaveOrgWithBadArgs() throws Exception {
    assertThrows(() -> instance.saveOrganization(null)).isInstanceOf(InvalidArgumentException.class);
    assertThrows(() -> instance.saveOrganization(new Organization())).isInstanceOf(InvalidArgumentException.class);
}
Also used : Organization(tech.aroma.thrift.Organization) Test(org.junit.Test) DontRepeat(tech.sirwellington.alchemy.test.junit.runners.DontRepeat)

Example 18 with DontRepeat

use of tech.sirwellington.alchemy.test.junit.runners.DontRepeat in project aroma-data-operations by RedRoma.

the class MeasuredUserRepositoryTest method testFindByGithubProfileWhenThrows.

@DontRepeat
@Test
public void testFindByGithubProfileWhenThrows() throws Exception {
    when(delegate.findByGithubProfile(githubProfile)).thenThrow(new OperationFailedException());
    assertThrows(() -> instance.findByGithubProfile(githubProfile)).isInstanceOf(OperationFailedException.class);
    verify(delegate).findByGithubProfile(githubProfile);
}
Also used : OperationFailedException(tech.aroma.thrift.exceptions.OperationFailedException) Test(org.junit.Test) DontRepeat(tech.sirwellington.alchemy.test.junit.runners.DontRepeat)

Example 19 with DontRepeat

use of tech.sirwellington.alchemy.test.junit.runners.DontRepeat in project aroma-data-operations by RedRoma.

the class MeasuredApplicationRepositoryTest method testDeleteApplicationWhenThrows.

@DontRepeat
@Test
public void testDeleteApplicationWhenThrows() throws Exception {
    doThrow(new ApplicationDoesNotExistException()).when(delegate).deleteApplication(appId);
    assertThrows(() -> instance.deleteApplication(appId)).isInstanceOf(ApplicationDoesNotExistException.class);
    verify(delegate).deleteApplication(appId);
}
Also used : ApplicationDoesNotExistException(tech.aroma.thrift.exceptions.ApplicationDoesNotExistException) Test(org.junit.Test) DontRepeat(tech.sirwellington.alchemy.test.junit.runners.DontRepeat)

Example 20 with DontRepeat

use of tech.sirwellington.alchemy.test.junit.runners.DontRepeat in project aroma-data-operations by RedRoma.

the class MeasuredApplicationRepositoryTest method testContainsApplicationWhenThrows.

@DontRepeat
@Test
public void testContainsApplicationWhenThrows() throws Exception {
    when(delegate.containsApplication(appId)).thenThrow(new OperationFailedException());
    assertThrows(() -> instance.containsApplication(appId)).isInstanceOf(OperationFailedException.class);
}
Also used : OperationFailedException(tech.aroma.thrift.exceptions.OperationFailedException) Test(org.junit.Test) DontRepeat(tech.sirwellington.alchemy.test.junit.runners.DontRepeat)

Aggregations

DontRepeat (tech.sirwellington.alchemy.test.junit.runners.DontRepeat)21 Test (org.junit.Test)20 OperationFailedException (tech.aroma.thrift.exceptions.OperationFailedException)6 Message (tech.aroma.thrift.Message)4 User (tech.aroma.thrift.User)4 UserDoesNotExistException (tech.aroma.thrift.exceptions.UserDoesNotExistException)3 Application (tech.aroma.thrift.Application)2 Organization (tech.aroma.thrift.Organization)2 UUID.fromString (java.util.UUID.fromString)1 Image (tech.aroma.thrift.Image)1 ApplicationDoesNotExistException (tech.aroma.thrift.exceptions.ApplicationDoesNotExistException)1 IntegrationTest (tech.sirwellington.alchemy.annotations.testing.IntegrationTest)1 TimeSensitive (tech.sirwellington.alchemy.annotations.testing.TimeSensitive)1 StringGenerators.alphabeticString (tech.sirwellington.alchemy.generator.StringGenerators.alphabeticString)1 GenerateString (tech.sirwellington.alchemy.test.junit.runners.GenerateString)1