Search in sources :

Example 1 with AccountsRepository

use of com.nexblocks.authguard.dal.persistence.AccountsRepository 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);
}
Also used : MessageBus(com.nexblocks.authguard.emb.MessageBus) AccountsRepository(com.nexblocks.authguard.dal.persistence.AccountsRepository) ServiceMapperImpl(com.nexblocks.authguard.service.mappers.ServiceMapperImpl) RolesService(com.nexblocks.authguard.service.RolesService) IdempotencyService(com.nexblocks.authguard.service.IdempotencyService) PermissionsService(com.nexblocks.authguard.service.PermissionsService) ConfigContext(com.nexblocks.authguard.config.ConfigContext) AccountConfig(com.nexblocks.authguard.service.config.AccountConfig) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ConfigContext (com.nexblocks.authguard.config.ConfigContext)1 AccountsRepository (com.nexblocks.authguard.dal.persistence.AccountsRepository)1 MessageBus (com.nexblocks.authguard.emb.MessageBus)1 IdempotencyService (com.nexblocks.authguard.service.IdempotencyService)1 PermissionsService (com.nexblocks.authguard.service.PermissionsService)1 RolesService (com.nexblocks.authguard.service.RolesService)1 AccountConfig (com.nexblocks.authguard.service.config.AccountConfig)1 ServiceMapperImpl (com.nexblocks.authguard.service.mappers.ServiceMapperImpl)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1