use of com.enonic.xp.core.impl.audit.config.AuditLogConfig in project xp by enonic.
the class AuditLogRepoInitializerTest method setUp.
@BeforeEach
public void setUp() {
RepositoryService repositoryService = Mockito.mock(RepositoryService.class);
IndexService indexService = Mockito.mock(IndexService.class);
AuditLogConfig config = Mockito.mock(AuditLogConfig.class);
Mockito.when(config.isEnabled()).thenReturn(true);
Mockito.when(config.isOutputLogs()).thenReturn(true);
auditLogService = new AuditLogServiceImpl(config, indexService, repositoryService, null);
Mockito.when(indexService.isMaster()).thenReturn(true);
Mockito.when(indexService.waitForYellowStatus()).thenReturn(true);
Mockito.when(repositoryService.createRepository(Mockito.any(CreateRepositoryParams.class))).thenReturn(null);
Mockito.when(repositoryService.isInitialized(Mockito.any(RepositoryId.class))).thenReturn(false);
}
use of com.enonic.xp.core.impl.audit.config.AuditLogConfig in project xp by enonic.
the class AuditLogServiceImplDisabledTest method setUp.
@BeforeEach
public void setUp() throws Exception {
AuditLogConfig config = Mockito.mock(AuditLogConfig.class);
Mockito.when(config.isEnabled()).thenReturn(false);
Mockito.when(config.isOutputLogs()).thenReturn(true);
IndexService indexService = Mockito.mock(IndexService.class);
Mockito.when(indexService.waitForYellowStatus()).thenReturn(true);
Mockito.when(indexService.isMaster()).thenReturn(true);
RepositoryService repositoryService = Mockito.mock(RepositoryService.class);
auditLogService = new AuditLogServiceImpl(config, indexService, repositoryService, null);
auditLogService.initialize();
}
use of com.enonic.xp.core.impl.audit.config.AuditLogConfig in project xp by enonic.
the class AbstractAuditLogServiceTest method setUp.
@BeforeEach
public void setUp() throws Exception {
executorService = Executors.newSingleThreadExecutor();
deleteAllIndices();
final MemoryBlobStore blobStore = new MemoryBlobStore();
this.binaryService = new BinaryServiceImpl();
this.binaryService.setBlobStore(blobStore);
final StorageDaoImpl storageDao = new StorageDaoImpl();
storageDao.setClient(client);
final EventPublisherImpl eventPublisher = new EventPublisherImpl(executorService);
this.searchDao = new SearchDaoImpl();
this.searchDao.setClient(client);
this.branchService = new BranchServiceImpl();
this.branchService.setStorageDao(storageDao);
this.branchService.setSearchDao(this.searchDao);
this.versionService = new VersionServiceImpl();
this.versionService.setStorageDao(storageDao);
this.indexServiceInternal = new IndexServiceInternalImpl();
this.indexServiceInternal.setClient(client);
this.nodeDao = new NodeVersionServiceImpl();
this.nodeDao.setBlobStore(blobStore);
this.indexedDataService = new IndexDataServiceImpl();
this.indexedDataService.setStorageDao(storageDao);
this.indexService = new IndexServiceImpl();
this.indexService.setIndexServiceInternal(this.indexServiceInternal);
this.storageService = new NodeStorageServiceImpl();
this.storageService.setBranchService(this.branchService);
this.storageService.setVersionService(this.versionService);
this.storageService.setNodeVersionService(this.nodeDao);
this.storageService.setIndexDataService(this.indexedDataService);
this.searchService = new NodeSearchServiceImpl();
this.searchService.setSearchDao(this.searchDao);
final NodeRepositoryServiceImpl nodeRepositoryService = new NodeRepositoryServiceImpl();
nodeRepositoryService.setIndexServiceInternal(this.indexServiceInternal);
final IndexServiceInternalImpl elasticsearchIndexService = new IndexServiceInternalImpl();
elasticsearchIndexService.setClient(client);
final RepositoryEntryServiceImpl repositoryEntryService = new RepositoryEntryServiceImpl();
repositoryEntryService.setIndexServiceInternal(elasticsearchIndexService);
repositoryEntryService.setNodeStorageService(this.storageService);
repositoryEntryService.setNodeSearchService(this.searchService);
repositoryEntryService.setEventPublisher(eventPublisher);
repositoryEntryService.setBinaryService(this.binaryService);
this.repositoryService = new RepositoryServiceImpl(repositoryEntryService, elasticsearchIndexService, nodeRepositoryService, this.storageService, this.searchService);
this.repositoryService.initialize();
this.nodeService = new NodeServiceImpl();
this.nodeService.setIndexServiceInternal(indexServiceInternal);
this.nodeService.setNodeStorageService(storageService);
this.nodeService.setNodeSearchService(searchService);
this.nodeService.setEventPublisher(eventPublisher);
this.nodeService.setBinaryService(this.binaryService);
this.nodeService.setRepositoryService(this.repositoryService);
this.nodeService.initialize();
AuditLogConfig config = Mockito.mock(AuditLogConfig.class);
Mockito.when(config.isEnabled()).thenReturn(true);
Mockito.when(config.isOutputLogs()).thenReturn(true);
this.auditLogService = new AuditLogServiceImpl(config, this.indexService, this.repositoryService, this.nodeService);
this.auditLogService.initialize();
initializeRepository();
}
Aggregations