@Test
public void testAddSmilToArchive() throws Exception {

  final String mpId = UUID.randomUUID().toString();
  final URI archiveElementURI = new URI("http://host.tld/archive/cut.smil");
  final String smilId = "s-afe311c6-9161-41f4-98d0-e951fe66d89e";
  Workspace workspace = createNiceMock(Workspace.class);
  expect(workspace.put(same(mpId), same(smilId), same("cut.smil"), anyObject(InputStream.class)))
          .andReturn(archiveElementURI);
  replay(workspace);
  endpoint.setWorkspace(workspace);
  AssetManager assetManager = createNiceMock(AssetManager.class);
  replay(assetManager);
  endpoint.setAssetManager(assetManager);
  MediaPackage mp = MediaPackageBuilderFactory.newInstance().newMediaPackageBuilder().createNew(new IdImpl(mpId));
  endpoint.addSmilToArchive(mp, smil);
  assertEquals(1, mp.getCatalogs().length);
  assertEquals(smil.getId(), mp.getCatalogs()[0].getIdentifier());
  assertEquals("smil/cutting", mp.getCatalogs()[0].getFlavor().toString());
}