@Test
public void testGet_DOI_out_of_item_metadata()
        throws SQLException, AuthorizeException, IOException, IdentifierException, IllegalAccessException, WorkflowException
{

    Item item = newItem();
    String doi = DOI.SCHEME + PREFIX + "/" + NAMESPACE_SEPARATOR 
            + Long.toHexString(new Date().getTime());
    context.turnOffAuthorisationSystem();
    itemService.addMetadata(context, item, DOIIdentifierProvider.MD_SCHEMA,
            DOIIdentifierProvider.DOI_ELEMENT,
            DOIIdentifierProvider.DOI_QUALIFIER,
            null,
            doiService.DOIToExternalForm(doi));
    itemService.update(context, item);
    context.restoreAuthSystemState();
    assertTrue("Failed to recognize DOI in item metadata.", 
            doi.equals(provider.getDOIOutOfObject(item)));
}