Search in sources :

Example 1 with VocabularyEnforcementJob

use of edu.unc.lib.boxc.deposit.normalize.VocabularyEnforcementJob in project box-c by UNC-Libraries.

the class VocabularyEnforcementJobTest method setup.

@Before
public void setup() throws Exception {
    job = new VocabularyEnforcementJob();
    job.setDepositUUID(depositUUID);
    job.setDepositDirectory(depositDir);
    setField(job, "pidMinter", pidMinter);
    setField(job, "depositsDirectory", depositsDirectory);
    setField(job, "jobStatusFactory", jobStatusFactory);
    setField(job, "depositStatusFactory", depositStatusFactory);
    setField(job, "vocabManager", vocabManager);
    setField(job, "depositModelManager", depositModelManager);
    PID depositPid = pidMinter.mintContentPid();
    depositStatus = new HashMap<>();
    depositStatus.put(DepositField.containerId.name(), depositPid.toString());
    when(depositStatusFactory.get(anyString())).thenReturn(depositStatus);
    Model model = job.getWritableModel();
    Bag depositBag = model.createBag(job.getDepositPID().getURI());
    rescPid = pidMinter.mintContentPid();
    Resource mainResource = model.createResource(rescPid.getURI());
    depositBag.add(mainResource);
    job.closeModel();
}
Also used : VocabularyEnforcementJob(edu.unc.lib.boxc.deposit.normalize.VocabularyEnforcementJob) Model(org.apache.jena.rdf.model.Model) Resource(org.apache.jena.rdf.model.Resource) Bag(org.apache.jena.rdf.model.Bag) PID(edu.unc.lib.boxc.model.api.ids.PID) Before(org.junit.Before)

Aggregations

VocabularyEnforcementJob (edu.unc.lib.boxc.deposit.normalize.VocabularyEnforcementJob)1 PID (edu.unc.lib.boxc.model.api.ids.PID)1 Bag (org.apache.jena.rdf.model.Bag)1 Model (org.apache.jena.rdf.model.Model)1 Resource (org.apache.jena.rdf.model.Resource)1 Before (org.junit.Before)1