@Test
public void testStore_DOI_as_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();
    provider.saveDOIToObject(context, item, doi);
    context.restoreAuthSystemState();
    
    List<MetadataValue> metadata = itemService.getMetadata(item, DOIIdentifierProvider.MD_SCHEMA,
            DOIIdentifierProvider.DOI_ELEMENT,
            DOIIdentifierProvider.DOI_QUALIFIER,
            null);
    boolean result = false;
    for (MetadataValue id : metadata)
    {
        if (id.getValue().equals(doiService.DOIToExternalForm(doi)))
        {
            result = true;
        }
    }
    assertTrue("Cannot store DOI as item metadata value.", result);
}