@Test
public void testMergeScheduledMediaPackage() throws Exception {

  MediaPackage ingestMediaPackage = MediaPackageParser
          .getFromXml(IOUtils.toString(getClass().getResourceAsStream("/source-manifest-partial.xml"), "UTF-8"));
  Dictionary<String, String> properties = new Hashtable<>();
  properties.put(IngestServiceImpl.SKIP_ATTACHMENTS_KEY, "false");
  properties.put(IngestServiceImpl.SKIP_CATALOGS_KEY, "false");
  properties.put(IngestServiceImpl.ADD_ONLY_NEW_FLAVORS_KEY, "false");
  service.updated(properties);
  MediaPackage mergedMediaPackage = service.ingest(ingestMediaPackage).getMediaPackage();
  Assert.assertEquals(4, mergedMediaPackage.getTracks().length);
  Track track = mergedMediaPackage.getTrack("track-1");
  Assert.assertEquals("/vonlya1.mov", track.getURI().toString());
  Assert.assertEquals(4, mergedMediaPackage.getCatalogs().length);
  Assert.assertEquals(2, mergedMediaPackage.getAttachments().length);
  Attachment attachment = mergedMediaPackage.getAttachment("cover");
  Assert.assertEquals("attachments/cover.png", attachment.getURI().toString());
  // Validate fields
  Assert.assertEquals(10045L, mergedMediaPackage.getDuration().doubleValue(), 0L);
  Assert.assertEquals("t2", mergedMediaPackage.getTitle());
  Assert.assertEquals("s2", mergedMediaPackage.getSeries());
  Assert.assertEquals("st2", mergedMediaPackage.getSeriesTitle());
  Assert.assertEquals("l2", mergedMediaPackage.getLicense());
  Assert.assertEquals(1, mergedMediaPackage.getSubjects().length);
  Assert.assertEquals("s2", mergedMediaPackage.getSubjects()[0]);
  Assert.assertEquals(1, mergedMediaPackage.getContributors().length);
  Assert.assertEquals("sd2", mergedMediaPackage.getContributors()[0]);
  Assert.assertEquals(1, mergedMediaPackage.getCreators().length);
  Assert.assertEquals("p2", mergedMediaPackage.getCreators()[0]);
}