@Test
public void testRetract() throws NotFoundException, PublicationException, ServiceRegistryException {

  ServiceRegistry serviceRegistry = EasyMock.createNiceMock(ServiceRegistry.class);
  Job dummyJob = EasyMock.createMock(Job.class);
  Capture<List<String>> jobArgsCapture = EasyMock.newCapture();
  EasyMock.expect(serviceRegistry.createJob(
          eq(OaiPmhPublicationService.JOB_TYPE),
          eq(OaiPmhPublicationServiceImpl.Operation.Retract.toString()),
          capture(jobArgsCapture))).andReturn(dummyJob).once();
  EasyMock.replay(serviceRegistry);
  service.setServiceRegistry(serviceRegistry);
  Job j = service.retract(mp2, "default");
  Assert.assertSame(dummyJob, j);
  // test job arguments
  List<String> jobArgs = jobArgsCapture.getValue();
  Assert.assertEquals(2, jobArgs.size());
  Assert.assertTrue(jobArgs.get(0).contains("<mediapackage "));
  Assert.assertEquals("default", jobArgs.get(1));
}