use of edu.unc.lib.boxc.deposit.fcrepo4.IngestContentObjectsJob in project box-c by UNC-Libraries.
the class IngestContentObjectsJobIT method constructJob.
private void constructJob() {
job = new IngestContentObjectsJob();
job.setJobUUID(jobUUID);
job.setDepositUUID(depositUUID);
job.setDepositDirectory(depositDir);
job.setPremisLoggerFactory(premisLoggerFactory);
setField(job, "pidMinter", pidMinter);
setField(job, "aclService", aclService);
setField(job, "depositModelManager", depositModelManager);
setField(job, "depositsDirectory", depositsDirectory);
setField(job, "depositStatusFactory", depositStatusFactory);
setField(job, "txManager", txManager);
setField(job, "jobStatusFactory", jobStatusFactory);
setField(job, "metricsClient", metricsClient);
setField(job, "repoObjLoader", repoObjLoader);
setField(job, "repoObjFactory", repoObjFactory);
setField(job, "fcrepoClient", fcrepoClient);
setField(job, "verificationService", verificationService);
setField(job, "transferService", binaryTransferService);
setField(job, "locationManager", storageLocationManager);
setField(job, "updateDescService", updateDescService);
job.init();
}
use of edu.unc.lib.boxc.deposit.fcrepo4.IngestContentObjectsJob in project box-c by UNC-Libraries.
the class IngestContentObjectsJobTest method init.
@Before
public void init() throws Exception {
job = new IngestContentObjectsJob();
job.setJobUUID(jobUUID);
job.setDepositUUID(depositUUID);
job.setDepositDirectory(depositDir);
setField(job, "premisLoggerFactory", mockPremisLoggerFactory);
setField(job, "aclService", aclService);
setField(job, "depositModelManager", depositModelManager);
setField(job, "depositsDirectory", depositsDirectory);
setField(job, "depositStatusFactory", depositStatusFactory);
setField(job, "jobStatusFactory", jobStatusFactory);
setField(job, "metricsClient", metricsClient);
setField(job, "pidMinter", pidMinter);
setField(job, "repoObjLoader", repoObjLoader);
setField(job, "repoObjFactory", repoObjFactory);
setField(job, "fcrepoClient", fcrepoClient);
setField(job, "txManager", txManager);
setField(job, "verificationService", verificationService);
setField(job, "transferService", binaryTransferService);
setField(job, "locationManager", storageLocationManager);
setField(job, "updateDescService", updateDescService);
setField(job, "depositModelManager", depositModelManager);
job.init();
depositPid = job.getDepositPID();
setupDestination();
FileUtils.copyDirectory(new File("src/test/resources/examples"), depositDir);
storageLocPath = tmpFolder.newFolder("storageLoc").toPath();
// Setup logging dependencies
mockPremisEventBuilder = mock(PremisEventBuilder.class, new SelfReturningAnswer());
when(mockPremisLoggerFactory.createPremisLogger(any())).thenReturn(mockPremisLogger);
when(mockPremisLoggerFactory.createPremisLogger(any(PID.class), any(File.class))).thenReturn(mockPremisLogger);
when(mockPremisLogger.buildEvent(any(Resource.class))).thenReturn(mockPremisEventBuilder);
when(mockFileObj.getOriginalFile()).thenReturn(mockBinaryObj);
// Get a writeable model
model = job.getWritableModel();
depBag = model.createBag(depositPid.getRepositoryPath());
when(fcrepoClient.head(any(URI.class))).thenReturn(headBuilder);
when(txManager.startTransaction()).thenReturn(mockTx);
doThrow(new TransactionCancelledException()).when(mockTx).cancel(any(Exception.class));
depBag.addProperty(Cdr.storageLocation, LOC1_ID);
when(storageLocationManager.getStorageLocationById(anyString())).thenReturn(storageLocation);
when(binaryTransferService.getSession(any(StorageLocation.class))).thenReturn(mockTransferSession);
}
Aggregations