@Test
public void testExtraMetadataDefaultNS() throws WorkflowOperationException {

  final EName customProperty = new EName(DublinCores.OC_PROPERTY_NS_URI, "my-custom-property");
  final String customValue = "my-custom-value";
  // Add extra metadata to the series catalog.
  seriesCatalog.set(DublinCore.PROPERTY_LANGUAGE, "Opencastian");
  seriesCatalog.set(DublinCore.PROPERTY_CONTRIBUTOR, Arrays.asList(
          new DublinCoreValue[] { DublinCoreValue.mk("Mr. Contry Bute"), DublinCoreValue.mk("Mrs. Jane Doe") }));
  seriesCatalog.set(customProperty, customValue);
  // Prepare "copy metadata" property
  // All field names without namespace
  // However, in the series metadata, the third one has a different NS than the other two
  String[] extraMetadata = {
          DublinCore.PROPERTY_LANGUAGE.getLocalName(),
          DublinCore.PROPERTY_CONTRIBUTOR.getLocalName(),
          customProperty.getLocalName()
  };
  WorkflowInstanceImpl instance = new WorkflowInstanceImpl();
  List<WorkflowOperationInstance> ops = new ArrayList<WorkflowOperationInstance>();
  WorkflowOperationInstanceImpl operation = new WorkflowOperationInstanceImpl("test", OperationState.INSTANTIATED);
  ops.add(operation);
  instance.setOperations(ops);
  instance.setMediaPackage(mp);
  MediaPackage clone = (MediaPackage) mp.clone();
  operation.setConfiguration(SeriesWorkflowOperationHandler.SERIES_PROPERTY, "series1");
  operation.setConfiguration(SeriesWorkflowOperationHandler.ATTACH_PROPERTY, "*");
  operation.setConfiguration(SeriesWorkflowOperationHandler.APPLY_ACL_PROPERTY, "false");
  operation.setConfiguration(SeriesWorkflowOperationHandler.COPY_METADATA_PROPERTY,
          StringUtils.join(extraMetadata, ", "));
  // Set the namespace of the third, custom property as the default
  operation.setConfiguration(SeriesWorkflowOperationHandler.DEFAULT_NS_PROPERTY, DublinCores.OC_PROPERTY_NS_URI);
  WorkflowOperationResult result = operationHandler.start(instance, null);
  Assert.assertEquals(Action.CONTINUE, result.getAction());
  MediaPackage resultingMediapackage = result.getMediaPackage();
  Assert.assertEquals("series1", resultingMediapackage.getSeries());
  Assert.assertEquals("Series 1", resultingMediapackage.getSeriesTitle());
  Assert.assertEquals(clone.getElements().length + 1, resultingMediapackage.getElements().length);
  // Get episode DublinCore
  DublinCoreCatalog episodeCatalog = DublinCores.read(capturedStream.getValue());
  // Only the later metadatum should have been resolved. The other had a different namespace.
  Assert.assertFalse(episodeCatalog.hasValue(DublinCore.PROPERTY_CONTRIBUTOR));
  Assert.assertFalse(episodeCatalog.hasValue(DublinCore.PROPERTY_LANGUAGE));
  Assert.assertTrue(episodeCatalog.hasValue(customProperty));
  Assert.assertEquals(seriesCatalog.get(customProperty),
          episodeCatalog.get(customProperty));
}