@Test
public void testProcess() throws Exception {

  Workspace workspace = EasyMock.createNiceMock(Workspace.class);
  EasyMock.expect(workspace.get(EasyMock.anyObject()))
          .andReturn(new File(audioTrack.getURI()));
  Capture<String> filenameCapture = Capture.newInstance();
  EasyMock.expect(workspace.putInCollection(
          EasyMock.anyString(), EasyMock.capture(filenameCapture), EasyMock.anyObject()))
          .andReturn(new URI("waveform.png"));
  EasyMock.replay(workspace);
  WaveformServiceImpl instance = new WaveformServiceImpl();
  instance.setWorkspace(workspace);
  String audioTrackXml = MediaPackageElementParser.getAsXml(audioTrack);
  Job job = new JobImpl(1);
  job.setJobType(WaveformServiceImpl.JOB_TYPE);
  job.setOperation(WaveformServiceImpl.Operation.Waveform.toString());
  job.setArguments(Arrays.asList(audioTrackXml, "200", "5000", "20000", "500", "black"));
  String result = instance.process(job);
  assertNotNull(result);
  MediaPackageElement waveformAttachment = MediaPackageElementParser.getFromXml(result);
  assertEquals(new URI("waveform.png"), waveformAttachment.getURI());
  assertTrue(filenameCapture.hasCaptured());
}