Search in sources :

Example 1 with AuditLogServiceImpl

use of com.enonic.xp.core.impl.audit.AuditLogServiceImpl 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();
}
Also used : BinaryServiceImpl(com.enonic.xp.repo.impl.binary.BinaryServiceImpl) SearchDaoImpl(com.enonic.xp.repo.impl.elasticsearch.search.SearchDaoImpl) NodeVersionServiceImpl(com.enonic.xp.repo.impl.node.dao.NodeVersionServiceImpl) VersionServiceImpl(com.enonic.xp.repo.impl.version.VersionServiceImpl) NodeVersionServiceImpl(com.enonic.xp.repo.impl.node.dao.NodeVersionServiceImpl) NodeRepositoryServiceImpl(com.enonic.xp.repo.impl.repository.NodeRepositoryServiceImpl) EventPublisherImpl(com.enonic.xp.core.impl.event.EventPublisherImpl) IndexDataServiceImpl(com.enonic.xp.repo.impl.storage.IndexDataServiceImpl) BranchServiceImpl(com.enonic.xp.repo.impl.branch.storage.BranchServiceImpl) NodeRepositoryServiceImpl(com.enonic.xp.repo.impl.repository.NodeRepositoryServiceImpl) RepositoryServiceImpl(com.enonic.xp.repo.impl.repository.RepositoryServiceImpl) IndexServiceImpl(com.enonic.xp.repo.impl.index.IndexServiceImpl) NodeServiceImpl(com.enonic.xp.repo.impl.node.NodeServiceImpl) AuditLogConfig(com.enonic.xp.core.impl.audit.config.AuditLogConfig) RepositoryEntryServiceImpl(com.enonic.xp.repo.impl.repository.RepositoryEntryServiceImpl) StorageDaoImpl(com.enonic.xp.repo.impl.elasticsearch.storage.StorageDaoImpl) AuditLogServiceImpl(com.enonic.xp.core.impl.audit.AuditLogServiceImpl) IndexServiceInternalImpl(com.enonic.xp.repo.impl.elasticsearch.IndexServiceInternalImpl) NodeStorageServiceImpl(com.enonic.xp.repo.impl.storage.NodeStorageServiceImpl) MemoryBlobStore(com.enonic.xp.internal.blobstore.MemoryBlobStore) NodeSearchServiceImpl(com.enonic.xp.repo.impl.search.NodeSearchServiceImpl) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

AuditLogServiceImpl (com.enonic.xp.core.impl.audit.AuditLogServiceImpl)1 AuditLogConfig (com.enonic.xp.core.impl.audit.config.AuditLogConfig)1 EventPublisherImpl (com.enonic.xp.core.impl.event.EventPublisherImpl)1 MemoryBlobStore (com.enonic.xp.internal.blobstore.MemoryBlobStore)1 BinaryServiceImpl (com.enonic.xp.repo.impl.binary.BinaryServiceImpl)1 BranchServiceImpl (com.enonic.xp.repo.impl.branch.storage.BranchServiceImpl)1 IndexServiceInternalImpl (com.enonic.xp.repo.impl.elasticsearch.IndexServiceInternalImpl)1 SearchDaoImpl (com.enonic.xp.repo.impl.elasticsearch.search.SearchDaoImpl)1 StorageDaoImpl (com.enonic.xp.repo.impl.elasticsearch.storage.StorageDaoImpl)1 IndexServiceImpl (com.enonic.xp.repo.impl.index.IndexServiceImpl)1 NodeServiceImpl (com.enonic.xp.repo.impl.node.NodeServiceImpl)1 NodeVersionServiceImpl (com.enonic.xp.repo.impl.node.dao.NodeVersionServiceImpl)1 NodeRepositoryServiceImpl (com.enonic.xp.repo.impl.repository.NodeRepositoryServiceImpl)1 RepositoryEntryServiceImpl (com.enonic.xp.repo.impl.repository.RepositoryEntryServiceImpl)1 RepositoryServiceImpl (com.enonic.xp.repo.impl.repository.RepositoryServiceImpl)1 NodeSearchServiceImpl (com.enonic.xp.repo.impl.search.NodeSearchServiceImpl)1 IndexDataServiceImpl (com.enonic.xp.repo.impl.storage.IndexDataServiceImpl)1 NodeStorageServiceImpl (com.enonic.xp.repo.impl.storage.NodeStorageServiceImpl)1 VersionServiceImpl (com.enonic.xp.repo.impl.version.VersionServiceImpl)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1