@Test
public void testProcess() throws Exception {

  File file = new File(track.getURI());
  Workspace workspace = EasyMock.createNiceMock(Workspace.class);
  EasyMock.expect(workspace.get(EasyMock.anyObject()))
          .andReturn(file);
  Capture<String> filenameCapture = Capture.newInstance();
  EasyMock.expect(workspace.putInCollection(
          EasyMock.anyString(), EasyMock.capture(filenameCapture), EasyMock.anyObject()))
          .andReturn(new URI("timelinepreviews.png"));
  EasyMock.replay(workspace);
  TimelinePreviewsServiceImpl instance = new TimelinePreviewsServiceImpl();
  instance.setWorkspace(workspace);
  String trackXml = MediaPackageElementParser.getAsXml(track);
  Job job = new JobImpl(1);
  job.setJobType(TimelinePreviewsServiceImpl.JOB_TYPE);
  job.setOperation(TimelinePreviewsServiceImpl.Operation.TimelinePreview.toString());
  job.setArguments(Arrays.asList(trackXml, String.valueOf(10)));
  String result = instance.process(job);
  assertNotNull(result);
  MediaPackageElement timelinepreviewsAttachment = MediaPackageElementParser.getFromXml(result);
  assertEquals(new URI("timelinepreviews.png"), timelinepreviewsAttachment.getURI());
  assertTrue(filenameCapture.hasCaptured());
}