Search in sources :

Example 6 with AuthTokenService

use of org.summerb.microservices.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();
}
Also used : AuthTokenService(org.summerb.microservices.users.api.AuthTokenService) Test(org.junit.Test)

Example 7 with AuthTokenService

use of org.summerb.microservices.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();
}
Also used : AuthTokenService(org.summerb.microservices.users.api.AuthTokenService) Test(org.junit.Test)

Example 8 with AuthTokenService

use of org.summerb.microservices.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();
}
Also used : AuthTokenService(org.summerb.microservices.users.api.AuthTokenService) Test(org.junit.Test)

Example 9 with AuthTokenService

use of org.summerb.microservices.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();
}
Also used : AuthTokenService(org.summerb.microservices.users.api.AuthTokenService) Test(org.junit.Test)

Example 10 with AuthTokenService

use of org.summerb.microservices.users.api.AuthTokenService in project summerb by skarpushin.

the class AuthTokenServiceDbImplTest method testCreateAuthToken_defensive_passwordNull.

@Test(expected = IllegalArgumentException.class)
public void testCreateAuthToken_defensive_passwordNull() throws Exception {
    AuthTokenService fixture = AuthTokenServiceDbImplFactory.createAuthTokenServiceDbImpl();
    fixture.authenticate("", null, "");
    fail();
}
Also used : AuthTokenService(org.summerb.microservices.users.api.AuthTokenService) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)11 AuthTokenService (org.summerb.microservices.users.api.AuthTokenService)11 AuthToken (org.summerb.microservices.users.api.dto.AuthToken)1