use of com.nexblocks.authguard.service.mappers.ServiceMapperImpl in project AuthGuard by AuthGuard.
the class AuthorizationCodeToOidcTest method setup.
@BeforeEach
void setup() {
authorizationCodeVerifier = Mockito.mock(AuthorizationCodeVerifier.class);
accountsService = Mockito.mock(AccountsService.class);
openIdConnectTokenProvider = Mockito.mock(OpenIdConnectTokenProvider.class);
serviceMapper = new ServiceMapperImpl();
authorizationCodeToOidc = new AuthorizationCodeToOidc(new AccountsServiceAdapter(accountsService), authorizationCodeVerifier, openIdConnectTokenProvider, serviceMapper);
}
use of com.nexblocks.authguard.service.mappers.ServiceMapperImpl in project AuthGuard by AuthGuard.
the class OtpVerifierTest method setup.
void setup(final OtpConfig otpConfig) {
mockOtpRepository = Mockito.mock(OtpRepository.class);
final ConfigContext configContext = Mockito.mock(ConfigContext.class);
Mockito.when(configContext.asConfigBean(OtpConfig.class)).thenReturn(otpConfig);
otpVerifier = new OtpVerifier(mockOtpRepository, new ServiceMapperImpl());
}
use of com.nexblocks.authguard.service.mappers.ServiceMapperImpl in project AuthGuard by AuthGuard.
the class AccountsServiceImplTest method setup.
@BeforeEach
void setup() {
accountsRepository = Mockito.mock(AccountsRepository.class);
permissionsService = Mockito.mock(PermissionsService.class);
rolesService = Mockito.mock(RolesService.class);
idempotencyService = Mockito.mock(IdempotencyService.class);
messageBus = Mockito.mock(MessageBus.class);
final ConfigContext configContext = Mockito.mock(ConfigContext.class);
final AccountConfig accountConfig = AccountConfig.builder().verifyEmail(true).verifyPhoneNumber(true).defaultRolesByDomain(ImmutableMap.of("unit", Collections.singleton("def-role"), "main", Collections.singleton("not-def-role"))).build();
Mockito.when(configContext.asConfigBean(AccountConfig.class)).thenReturn(accountConfig);
serviceMapper = new ServiceMapperImpl();
accountService = new AccountsServiceImpl(accountsRepository, permissionsService, rolesService, idempotencyService, serviceMapper, messageBus, configContext);
}
use of com.nexblocks.authguard.service.mappers.ServiceMapperImpl in project AuthGuard by AuthGuard.
the class ApplicationsServiceImplTest method setup.
@BeforeEach
void setup() {
applicationsRepository = Mockito.mock(ApplicationsRepository.class);
accountsService = Mockito.mock(AccountsService.class);
idempotencyService = Mockito.mock(IdempotencyService.class);
messageBus = Mockito.mock(MessageBus.class);
serviceMapper = new ServiceMapperImpl();
applicationsService = new ApplicationsServiceImpl(applicationsRepository, accountsService, idempotencyService, serviceMapper, messageBus);
}
use of com.nexblocks.authguard.service.mappers.ServiceMapperImpl in project AuthGuard by AuthGuard.
the class CredentialsServiceImplTest method setup.
@BeforeEach
void setup() {
accountsService = Mockito.mock(AccountsService.class);
idempotencyService = Mockito.mock(IdempotencyService.class);
credentialsRepository = Mockito.mock(CredentialsRepository.class);
credentialsAuditRepository = Mockito.mock(CredentialsAuditRepository.class);
accountTokensRepository = Mockito.mock(AccountTokensRepository.class);
securePassword = Mockito.mock(SecurePassword.class);
securePasswordProvider = Mockito.mock(SecurePasswordProvider.class);
messageBus = Mockito.mock(MessageBus.class);
serviceMapper = new ServiceMapperImpl();
Mockito.when(securePasswordProvider.get()).thenReturn(securePassword);
Mockito.when(securePasswordProvider.getCurrentVersion()).thenReturn(1);
final PasswordValidator passwordValidator = new PasswordValidator(PasswordsConfig.builder().conditions(PasswordConditions.builder().build()).build());
credentialsService = new CredentialsServiceImpl(accountsService, idempotencyService, credentialsRepository, credentialsAuditRepository, accountTokensRepository, securePasswordProvider, passwordValidator, messageBus, serviceMapper);
Mockito.when(accountsService.getById(any())).thenReturn(Optional.of(RANDOM.nextObject(AccountBO.class)));
}
Aggregations