use of org.summerb.users.api.AuthTokenService in project summerb by skarpushin.
the class AuthTokenServiceDbImplTest method testFindUserAuthTokens_defensive_nullUser.
@Test(expected = IllegalArgumentException.class)
public void testFindUserAuthTokens_defensive_nullUser() throws Exception {
AuthTokenService fixture = AuthTokenServiceDbImplFactory.createAuthTokenServiceDbImpl();
fixture.findUserAuthTokens(null);
fail();
}
use of org.summerb.users.api.AuthTokenService in project summerb by skarpushin.
the class AuthTokenServiceDbImplTest method testCreateAuthToken_defensive_clientIpNull.
@Test(expected = IllegalArgumentException.class)
public void testCreateAuthToken_defensive_clientIpNull() throws Exception {
AuthTokenService fixture = AuthTokenServiceDbImplFactory.createAuthTokenServiceDbImpl();
fixture.authenticate("", "", null);
fail();
}
use of org.summerb.users.api.AuthTokenService in project summerb by skarpushin.
the class AuthTokenServiceDbImplTest method testCreateAuthToken_blackbox_expectFieldValidationException.
@Test(expected = FieldValidationException.class)
public void testCreateAuthToken_blackbox_expectFieldValidationException() throws Exception {
AuthTokenService fixture = AuthTokenServiceDbImplFactory.createAuthTokenServiceDbImpl();
fixture.authenticate("abra cadabra", "", "");
fail();
}
use of org.summerb.users.api.AuthTokenService in project summerb by skarpushin.
the class AuthTokenServiceDbImplTest method testCreateAuthToken_blackbox_expectUserNotFoundExpcetion.
@Test(expected = UserNotFoundException.class)
public void testCreateAuthToken_blackbox_expectUserNotFoundExpcetion() throws Exception {
AuthTokenService fixture = AuthTokenServiceDbImplFactory.createAuthTokenServiceDbImpl();
fixture.authenticate(UserFactory.NON_EXISTENT_USER_EMAIL, "", "");
fail();
}
use of org.summerb.users.api.AuthTokenService in project summerb by skarpushin.
the class AuthTokenServiceDbImplTest method testFindUserAuthTokens_whitebox_expectUserNotFoundExceptionForNonExistentUser.
@Test(expected = UserNotFoundException.class)
public void testFindUserAuthTokens_whitebox_expectUserNotFoundExceptionForNonExistentUser() throws Exception {
AuthTokenService fixture = AuthTokenServiceDbImplFactory.createAuthTokenServiceDbImpl();
fixture.findUserAuthTokens(UserFactory.NON_EXISTENT_USER);
fail();
}
Aggregations