Search in sources :

Example 1 with MockAppEventPublisher

use of org.eclipse.vorto.repository.utils.MockAppEventPublisher in project vorto by eclipse.

the class UnitTestBase method mockServices.

protected void mockServices() throws Exception {
    ModelRepositoryEventListener supervisor = new ModelRepositoryEventListener();
    IndexingEventListener indexingSupervisor = new IndexingEventListener(indexingService);
    Collection<ApplicationListener<AppEvent>> listeners = new ArrayList<>();
    listeners.add(supervisor);
    listeners.add(indexingSupervisor);
    ApplicationEventPublisher eventPublisher = new MockAppEventPublisher(listeners);
    mockAccountService(eventPublisher);
    mockUserService(eventPublisher);
    mockModelParserFactory();
    mockModelRepositoryFactory(eventPublisher);
    supervisor.setRepositoryFactory(repositoryFactory);
    modelParserFactory.setModelRepositoryFactory(repositoryFactory);
    searchService = new SimpleSearchService(namespaceRepository, repositoryFactory);
    supervisor.setSearchService(searchService);
    this.modelValidationHelper = new ModelValidationHelper(repositoryFactory, this.accountService, userRepositoryRoleService, userNamespaceRoleService);
    mockImporter(repositoryFactory);
    this.workflow = new DefaultWorkflowService(repositoryFactory, accountService, notificationService, namespaceService, userNamespaceRoleService, roleService);
}
Also used : ApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher) ApplicationListener(org.springframework.context.ApplicationListener) ModelValidationHelper(org.eclipse.vorto.repository.core.impl.utils.ModelValidationHelper) MockAppEventPublisher(org.eclipse.vorto.repository.utils.MockAppEventPublisher) DefaultWorkflowService(org.eclipse.vorto.repository.workflow.impl.DefaultWorkflowService) ModelRepositoryEventListener(org.eclipse.vorto.repository.core.impl.ModelRepositoryEventListener) IndexingEventListener(org.eclipse.vorto.repository.search.IndexingEventListener) SimpleSearchService(org.eclipse.vorto.repository.search.impl.SimpleSearchService)

Aggregations

ModelRepositoryEventListener (org.eclipse.vorto.repository.core.impl.ModelRepositoryEventListener)1 ModelValidationHelper (org.eclipse.vorto.repository.core.impl.utils.ModelValidationHelper)1 IndexingEventListener (org.eclipse.vorto.repository.search.IndexingEventListener)1 SimpleSearchService (org.eclipse.vorto.repository.search.impl.SimpleSearchService)1 MockAppEventPublisher (org.eclipse.vorto.repository.utils.MockAppEventPublisher)1 DefaultWorkflowService (org.eclipse.vorto.repository.workflow.impl.DefaultWorkflowService)1 ApplicationEventPublisher (org.springframework.context.ApplicationEventPublisher)1 ApplicationListener (org.springframework.context.ApplicationListener)1