@Test
public void testEditorOperationStart() throws WorkflowOperationException, IOException {

  // uri for new preview track smil file
  EasyMock.expect(
          workspaceMock.put((String) EasyMock.anyObject(), (String) EasyMock.anyObject(),
                  (String) EasyMock.anyObject(), (InputStream) EasyMock.anyObject())).andReturn(
          URI.create("http://localhost:8080/foo/presenter.smil"));
  // uri for new episode smil file
  String episodeSmilUri = "http://localhost:8080/foo/episode.smil";
  EasyMock.expect(
          workspaceMock.put((String) EasyMock.anyObject(), (String) EasyMock.anyObject(),
                  (String) EasyMock.anyObject(), (InputStream) EasyMock.anyObject())).andReturn(
          URI.create(episodeSmilUri));
  EasyMock.replay(workspaceMock);
  WorkflowInstanceImpl workflowInstance = getWorkflowInstance(mp, getDefaultConfiguration(true));
  WorkflowOperationResult result = videoEditorWorkflowOperationHandler.start(workflowInstance, null);
  Assert.assertNotNull(
          "VideoEditor workflow operation returns null but should be an instantiated WorkflowOperationResult", result);
  EasyMock.verify(workspaceMock);
  WorkflowOperationInstance worflowOperationInstance = workflowInstance.getCurrentOperation();
  String smillFlavorsProperty = worflowOperationInstance.getConfiguration("smil-flavors");
  String previewFlavorsProperty = worflowOperationInstance.getConfiguration("preview-flavors");
  MediaPackageElementFlavor smilFlavor = MediaPackageElementFlavor.parseFlavor(smillFlavorsProperty);
  MediaPackageElementFlavor previewFlavor = MediaPackageElementFlavor.parseFlavor(previewFlavorsProperty);
  // each preview track (e.g. presenter/preview) should have an own smil catalog in media package
  Catalog[] previewSmilCatalogs = result.getMediaPackage().getCatalogs(
          new MediaPackageElementFlavor("presenter", "smil"));
  Assert.assertTrue(previewSmilCatalogs != null && previewSmilCatalogs.length > 0);
  for (Track track : result.getMediaPackage().getTracks()) {
    if (track.getFlavor().matches(previewFlavor)) {
      boolean smilCatalogFound = false;
      MediaPackageElementFlavor trackSmilFlavor = new MediaPackageElementFlavor(track.getFlavor().getType(),
              smilFlavor.getSubtype());
      for (Catalog previewSmilCatalog : previewSmilCatalogs) {
        if (previewSmilCatalog.getFlavor().matches(trackSmilFlavor)) {
          smilCatalogFound = true;
          break;
        }
      }
      Assert.assertTrue("Mediapackage doesn't contain a smil catalog with flavor " + trackSmilFlavor.toString(),
              smilCatalogFound);
    }
  }
  // an "target-smil-flavor catalog" schould be in media package
  String targetSmilFlavorProperty = worflowOperationInstance.getConfiguration("target-smil-flavor");
  Catalog[] episodeSmilCatalogs = result.getMediaPackage().getCatalogs(
          MediaPackageElementFlavor.parseFlavor(targetSmilFlavorProperty));
  Assert.assertTrue("Mediapackage should contain catalog with flavor " + targetSmilFlavorProperty,
          episodeSmilCatalogs != null && episodeSmilCatalogs.length > 0);
  Assert.assertTrue("Target smil catalog URI does not match",
          episodeSmilCatalogs[0].getURI().compareTo(URI.create(episodeSmilUri)) == 0);
}