Search in sources :

Example 6 with DontRepeat

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

the class MeasuredUserRepositoryTest method testContainsUserWhenThrows.

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

Example 7 with DontRepeat

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

the class MeasuredUserRepositoryTest method testGetUserWhenThrows.

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

Example 8 with DontRepeat

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

the class MeasuredUserRepositoryTest method testGetUserByEmailWhenThrows.

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

Example 9 with DontRepeat

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

the class MemoryUserRepositoryTest method testSaveUserWithBadArgs.

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

Example 10 with DontRepeat

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

the class MeasuredApplicationRepositoryTest method testSaveApplicationWhenThrows.

@DontRepeat
@Test
public void testSaveApplicationWhenThrows() throws Exception {
    doThrow(new OperationFailedException()).when(delegate).saveApplication(application);
    assertThrows(() -> instance.saveApplication(application)).isInstanceOf(OperationFailedException.class);
    verify(delegate).saveApplication(application);
}
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