use of org.alfresco.repo.admin.RepoServerMgmtMBean in project alfresco-repository by Alfresco.
the class SessionsUsageDataCollectorTest method setUp.
@Before
public void setUp() {
mockDescriptorDAO = mock(DescriptorDAO.class);
mockCollectorService = mock(HBDataCollectorService.class);
mockScheduler = mock(HeartBeatJobScheduler.class);
repoServerMgmtMBean = mock(RepoServerMgmtMBean.class);
when(repoServerMgmtMBean.getTicketCountNonExpired()).thenReturn(TICKET_NON_EXPIRED);
Descriptor mockDescriptor = mock(Descriptor.class);
when(mockDescriptor.getId()).thenReturn("mock_id");
when(mockDescriptorDAO.getDescriptor()).thenReturn(mockDescriptor);
sessionsUsageDataCollector = new SessionsUsageDataCollector("acs.repository.usage.sessions", "1.0", "0 0 0/1 ? * *", mockScheduler);
sessionsUsageDataCollector.setHbDataCollectorService(mockCollectorService);
sessionsUsageDataCollector.setCurrentRepoDescriptorDAO(mockDescriptorDAO);
sessionsUsageDataCollector.setRepoServerMgmt(repoServerMgmtMBean);
collectedData = sessionsUsageDataCollector.collectData();
}
Aggregations