CompositeWorkflowOperationHandler extends AbstractWorkflowOperationHandler { public void setWorkspace(Workspace workspace) { this.workspace = workspace; }  void setComposerService(ComposerService composerService); void setWorkspace(Workspace workspace); @Override WorkflowOperationResult start(final WorkflowInstance workflowInstance, JobContext context);  }
@Test public void testSingleVideoStream() throws URISyntaxException, MalformedURLException, MediaPackageException, IOException, IllegalArgumentException, NotFoundException, ServiceRegistryException { MediaPackageBuilder builder = MediaPackageBuilderFactory.newInstance().newMediaPackageBuilder(); URI uriMP = InspectWorkflowOperationHandler.class.getResource("/composite_mediapackage.xml").toURI(); URI uriMPEncode = InspectWorkflowOperationHandler.class.getResource("/compound_mediapackage.xml").toURI(); mp = builder.loadFromXml(uriMP.toURL().openStream()); mpEncode = builder.loadFromXml(uriMPEncode.toURL().openStream()); encodedTracks = mpEncode.getTracks(); workspace = EasyMock.createNiceMock(Workspace.class); EasyMock.expect( workspace.moveTo((URI) EasyMock.anyObject(), (String) EasyMock.anyObject(), (String) EasyMock.anyObject(), (String) EasyMock.anyObject())).andReturn(uriMPEncode); EasyMock.expect(workspace.get((URI) EasyMock.anyObject())).andReturn( new File(getClass().getResource("/watermark.jpg").toURI())); EasyMock.replay(workspace); job = EasyMock.createNiceMock(Job.class); EasyMock.expect(job.getPayload()).andReturn(MediaPackageElementParser.getAsXml(encodedTracks[0])).anyTimes(); EasyMock.expect(job.getStatus()).andReturn(Job.Status.FINISHED); EasyMock.expect(job.getDateCreated()).andReturn(new Date()); EasyMock.expect(job.getDateStarted()).andReturn(new Date()); EasyMock.expect(job.getQueueTime()).andReturn(new Long(0)); EasyMock.replay(job); ServiceRegistry serviceRegistry = EasyMock.createNiceMock(ServiceRegistry.class); EasyMock.expect(serviceRegistry.getJob(EasyMock.anyLong())).andReturn(job); EasyMock.replay(serviceRegistry); operationHandler = new CompositeWorkflowOperationHandler(); operationHandler.setWorkspace(workspace); operationHandler.setServiceRegistry(serviceRegistry); }