use of org.summerb.users.api.AuthTokenService in project summerb by skarpushin.
the class AuthTokenServiceDbImplTest method testCreateAuthToken_blackbox_expectInvalidPasswordException.
@Test(expected = InvalidPasswordException.class)
public void testCreateAuthToken_blackbox_expectInvalidPasswordException() throws Exception {
AuthTokenService fixture = AuthTokenServiceDbImplFactory.createAuthTokenServiceDbImpl();
fixture.authenticate(UserFactory.EXISTENT_USER_EMAIL, UUID.randomUUID().toString(), "");
fail();
}
use of org.summerb.users.api.AuthTokenService in project summerb by skarpushin.
the class AuthTokenServiceDbImplTest method testCreateAuthToken_blackbox_expectNewAuthToken.
@Test
public void testCreateAuthToken_blackbox_expectNewAuthToken() throws Exception {
AuthTokenService fixture = AuthTokenServiceDbImplFactory.createAuthTokenServiceDbImpl();
AuthToken result = fixture.authenticate(UserFactory.EXISTENT_USER_EMAIL, PasswordFactory.RIGHT_PASSWORD_FOR_EXISTENT_USER, "0.0.0.0");
assertNotNull(result);
}
use of org.summerb.users.api.AuthTokenService in project summerb by skarpushin.
the class AuthTokenServiceDbImplTest method testCreateAuthToken_whitebox_expectUserServiceUnexpectedExceptionOnDaoFail.
@Test(expected = UserServiceUnexpectedException.class)
public void testCreateAuthToken_whitebox_expectUserServiceUnexpectedExceptionOnDaoFail() throws Exception {
AuthTokenService fixture = AuthTokenServiceDbImplFactory.createAuthTokenServiceDbImpl();
fixture.authenticate(UserFactory.USER_EMAIL_RESULT_IN_EXCEPTION, "", "0.0.0.0");
fail();
}
use of org.summerb.users.api.AuthTokenService in project summerb by skarpushin.
the class AuthTokenServiceDbImplTest method testCreateAuthToken_defensive_userNull.
@Test(expected = IllegalArgumentException.class)
public void testCreateAuthToken_defensive_userNull() 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 testFindUserAuthTokens_whitebox_expectUnexpectedException.
@Test(expected = UserServiceUnexpectedException.class)
public void testFindUserAuthTokens_whitebox_expectUnexpectedException() throws Exception {
AuthTokenService fixture = AuthTokenServiceDbImplFactory.createAuthTokenServiceDbImpl();
fixture.findUserAuthTokens(UserFactory.USER_RESULT_IN_EXCEPTION);
fail();
}
Aggregations