use of org.summerb.microservices.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.microservices.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.microservices.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.microservices.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.microservices.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);
}
Aggregations