Search in sources :

Example 6 with SchedulerService

use of org.opencastproject.scheduler.api.SchedulerService in project opencast by opencast.

the class SchedulerMigrationServiceTest method setUp.

@Before
public void setUp() throws Exception {
    OrganizationDirectoryService orgDirService = createNiceMock(OrganizationDirectoryService.class);
    expect(orgDirService.getOrganization(anyString())).andReturn(new DefaultOrganization()).anyTimes();
    replay(orgDirService);
    SecurityService securityService = createNiceMock(SecurityService.class);
    expect(securityService.getOrganization()).andReturn(new DefaultOrganization()).anyTimes();
    expect(securityService.getUser()).andReturn(new JaxbUser()).anyTimes();
    replay(securityService);
    SchedulerTransaction schedulerTransaction = createNiceMock(SchedulerTransaction.class);
    replay(schedulerTransaction);
    SchedulerService schedulerService = createNiceMock(SchedulerService.class);
    expect(schedulerService.createTransaction(anyString())).andReturn(schedulerTransaction).anyTimes();
    expect(schedulerService.search(anyObject(Opt.class), anyObject(Opt.class), anyObject(Opt.class), anyObject(Opt.class), anyObject(Opt.class))).andReturn(new ArrayList<>());
    replay(schedulerService);
    Workspace workspace = createNiceMock(Workspace.class);
    expect(workspace.put(anyString(), anyString(), anyString(), anyObject(InputStream.class))).andReturn(new URI("test")).anyTimes();
    replay(workspace);
    AuthorizationService authorizationService = createNiceMock(AuthorizationService.class);
    replay(authorizationService);
    schedulerMigrationService.setAuthorizationService(authorizationService);
    schedulerMigrationService.setOrganizationDirectoryService(orgDirService);
    schedulerMigrationService.setSchedulerService(schedulerService);
    schedulerMigrationService.setSecurityService(securityService);
    schedulerMigrationService.setWorkspace(workspace);
}
Also used : SchedulerService(org.opencastproject.scheduler.api.SchedulerService) Opt(com.entwinemedia.fn.data.Opt) AuthorizationService(org.opencastproject.security.api.AuthorizationService) SecurityService(org.opencastproject.security.api.SecurityService) JaxbUser(org.opencastproject.security.api.JaxbUser) SchedulerTransaction(org.opencastproject.scheduler.api.SchedulerService.SchedulerTransaction) URI(java.net.URI) OrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService) DefaultOrganization(org.opencastproject.security.api.DefaultOrganization) Workspace(org.opencastproject.workspace.api.Workspace) Before(org.junit.Before)

Aggregations

SchedulerService (org.opencastproject.scheduler.api.SchedulerService)6 MediaPackage (org.opencastproject.mediapackage.MediaPackage)5 SecurityService (org.opencastproject.security.api.SecurityService)5 Test (org.junit.Test)4 Workspace (org.opencastproject.workspace.api.Workspace)4 Opt (com.entwinemedia.fn.data.Opt)3 InputStream (java.io.InputStream)3 URI (java.net.URI)3 CommonEventCatalogUIAdapter (org.opencastproject.index.service.catalog.adapter.events.CommonEventCatalogUIAdapter)3 DublinCoreCatalog (org.opencastproject.metadata.dublincore.DublinCoreCatalog)3 AuthorizationService (org.opencastproject.security.api.AuthorizationService)3 Date (java.util.Date)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 Capture (org.easymock.Capture)2 IAnswer (org.easymock.IAnswer)2 JSONObject (org.json.simple.JSONObject)2 Before (org.junit.Before)2 CaptureAgentStateService (org.opencastproject.capture.admin.api.CaptureAgentStateService)2 Catalog (org.opencastproject.mediapackage.Catalog)2