@Test
public void testStartOperation() throws WorkflowOperationException, SilenceDetectionFailedException,
        NotFoundException, ServiceRegistryException, MediaPackageException, SmilException, MalformedURLException, JAXBException, SAXException, IOException {

  Smil smil = smilService.fromXml(new File(smilURI)).getSmil();
  Job job = EasyMock.createNiceMock(Job.class);
  EasyMock.expect(job.getPayload()).andReturn(smil.toXML()).anyTimes();
  EasyMock.expect(job.getStatus()).andReturn(Job.Status.FINISHED);
  EasyMock.expect(silenceDetectionServiceMock.detect(
          (Track) EasyMock.anyObject(),
          (Track[]) EasyMock.anyObject()))
          .andReturn(job);
  EasyMock.expect(workspaceMock.put(
          (String) EasyMock.anyObject(),
          (String) EasyMock.anyObject(),
          (String) EasyMock.anyObject(),
          (InputStream) EasyMock.anyObject()))
          .andReturn(smilURI);
  ServiceRegistry serviceRegistry = EasyMock.createNiceMock(ServiceRegistry.class);
  silenceDetectionOperationHandler.setServiceRegistry(serviceRegistry);
  EasyMock.expect(serviceRegistry.getJob(EasyMock.anyLong())).andReturn(job);
  EasyMock.replay(job, serviceRegistry, silenceDetectionServiceMock, workspaceMock);
  WorkflowInstanceImpl workflowInstance = getWorkflowInstance(mp, getDefaultConfiguration());
  WorkflowOperationResult result = silenceDetectionOperationHandler.start(workflowInstance, null);
  Assert.assertNotNull("SilenceDetectionWorkflowOperationHandler workflow operation returns null "
          + "but should be an instantiated WorkflowOperationResult", result);
  EasyMock.verify(silenceDetectionServiceMock, workspaceMock);
  WorkflowOperationInstance worflowOperationInstance = workflowInstance.getCurrentOperation();
  String smilFlavorSubtypeProperty = worflowOperationInstance.getConfiguration("smil-flavor-subtype");
  // test media package contains new smil catalog
  MediaPackageElementFlavor smilPartialFlavor = new MediaPackageElementFlavor("*", smilFlavorSubtypeProperty);
  Catalog[] smilCatalogs = mp.getCatalogs(smilPartialFlavor);
  Assert.assertTrue("Media package should contain a smil catalog",
          smilCatalogs != null && smilCatalogs.length > 0);
}