Search in sources :

Example 1 with HBDataCollectorService

use of org.alfresco.service.cmr.repository.HBDataCollectorService in project alfresco-repository by Alfresco.

the class AuthoritiesDataCollectorTest method setUp.

@Before
public void setUp() {
    HBDataCollectorService mockCollectorService = mock(HBDataCollectorService.class);
    AuthorityService authorityService = mock(AuthorityService.class);
    mockScheduler = mock(HeartBeatJobScheduler.class);
    Descriptor mockDescriptor = mock(Descriptor.class);
    when(mockDescriptor.getId()).thenReturn("mock_id");
    DescriptorDAO descriptorDAO = mock(DescriptorDAO.class);
    when(descriptorDAO.getDescriptor()).thenReturn(mockDescriptor);
    authorityDataCollector = new AuthoritiesDataCollector("acs.repository.usage.authorities", "1.0", "0 0 0 ? * *", mockScheduler);
    authorityDataCollector.setAuthorityService(authorityService);
    authorityDataCollector.setCurrentRepoDescriptorDAO(descriptorDAO);
    authorityDataCollector.setHbDataCollectorService(mockCollectorService);
    collectedData = authorityDataCollector.collectData();
}
Also used : HeartBeatJobScheduler(org.alfresco.heartbeat.jobs.HeartBeatJobScheduler) AuthorityService(org.alfresco.service.cmr.security.AuthorityService) HBDataCollectorService(org.alfresco.service.cmr.repository.HBDataCollectorService) Descriptor(org.alfresco.service.descriptor.Descriptor) DescriptorDAO(org.alfresco.repo.descriptor.DescriptorDAO) Before(org.junit.Before)

Aggregations

HeartBeatJobScheduler (org.alfresco.heartbeat.jobs.HeartBeatJobScheduler)1 DescriptorDAO (org.alfresco.repo.descriptor.DescriptorDAO)1 HBDataCollectorService (org.alfresco.service.cmr.repository.HBDataCollectorService)1 AuthorityService (org.alfresco.service.cmr.security.AuthorityService)1 Descriptor (org.alfresco.service.descriptor.Descriptor)1 Before (org.junit.Before)1