Search in sources :

Example 1 with AssignStorageLocationsJob

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

the class AssignStorageLocationsJobTest method init.

@Before
public void init() throws Exception {
    destPid = makePid();
    when(locationManager.getStorageLocation(destPid)).thenReturn(storageLoc);
    when(storageLoc.getId()).thenReturn(LOC_ID);
    job = new AssignStorageLocationsJob(jobUUID, depositUUID);
    setField(job, "locationManager", locationManager);
    setField(job, "depositModelManager", depositModelManager);
    setField(job, "depositsDirectory", depositsDirectory);
    setField(job, "depositStatusFactory", depositStatusFactory);
    setField(job, "jobStatusFactory", jobStatusFactory);
    job.init();
    depositModel = job.getWritableModel();
    depBag = depositModel.createBag(depositPid.getRepositoryPath());
    depositStatus = new HashMap<>();
    depositStatus.put(DepositField.containerId.name(), destPid.getId());
    when(depositStatusFactory.get(anyString())).thenReturn(depositStatus);
}
Also used : AssignStorageLocationsJob(edu.unc.lib.boxc.deposit.normalize.AssignStorageLocationsJob) Before(org.junit.Before)

Aggregations

AssignStorageLocationsJob (edu.unc.lib.boxc.deposit.normalize.AssignStorageLocationsJob)1 Before (org.junit.Before)1