@Test
public void testPublish() throws Exception {

  Job job = createJob(1L, "anything", "anything");
  Capture<MediaPackage> capturedMp = Capture.newInstance();
  EasyMock.expect(searchService.add(EasyMock.capture(capturedMp))).andReturn(job);
  EasyMock.expect(serviceRegistry.getJob(1L)).andReturn(job).anyTimes();
  replayServices();
  MediaPackage mp = MediaPackageBuilderFactory.newInstance().newMediaPackageBuilder().createNew();
  mp.setIdentifier(new IdImpl(MP_ID));
  service.publish(mp);
  Assert.assertEquals(MP_ID, capturedMp.getValue().getIdentifier().toString());
}