Search in sources :

Example 1 with UserDoesNotExistException

use of tech.aroma.thrift.exceptions.UserDoesNotExistException 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)

Example 2 with UserDoesNotExistException

use of tech.aroma.thrift.exceptions.UserDoesNotExistException 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);
}
Also used : UserDoesNotExistException(tech.aroma.thrift.exceptions.UserDoesNotExistException) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 UserDoesNotExistException (tech.aroma.thrift.exceptions.UserDoesNotExistException)2