use of edu.unc.lib.boxc.deposit.normalize.CDRMETS2N3BagJob in project box-c by UNC-Libraries.
the class CDRMETS2N3BagJobTest method setup.
@Before
public void setup() throws Exception {
status = new HashMap<>();
when(depositStatusFactory.get(anyString())).thenReturn(status);
when(metsSipSchema.newValidator()).thenReturn(metsValidator);
makePid(RepositoryPathConstants.CONTENT_BASE);
data = new File(depositDir, "data");
data.mkdir();
Path metsPath = data.toPath().resolve("mets.xml");
stagingBaseUri = data.toPath().toUri().toString();
status.put(DepositField.sourceUri.name(), metsPath.toUri().toString());
job = new CDRMETS2N3BagJob(jobUUID, depositUUID);
setField(job, "depositModelManager", depositModelManager);
job.setDepositDirectory(depositDir);
setField(job, "depositsDirectory", depositsDirectory);
setField(job, "depositStatusFactory", depositStatusFactory);
setField(job, "metsSipSchema", metsSipSchema);
setField(job, "premisLoggerFactory", premisLoggerFactory);
setField(job, "pidMinter", pidMinter);
job.setSchematronValidator(schematronValidator);
when(schematronValidator.validateReportErrors(any(StreamSource.class), eq(METSProfile.CDR_SIMPLE.name()))).thenReturn(new ArrayList<String>());
when(premisLogger.buildEvent(eq(Premis.Validation))).thenReturn(premisEventBuilder);
when(premisLogger.buildEvent(eq(Premis.Normalization))).thenReturn(premisEventBuilder);
job.init();
}
Aggregations