use of edu.unc.lib.boxc.deposit.normalize.NormalizeFileObjectsJob in project box-c by UNC-Libraries.
the class NormalizeFileObjectsJobTest method init.
@Before
public void init() {
job = new NormalizeFileObjectsJob();
job.setDepositUUID(depositUUID);
job.setDepositDirectory(depositDir);
job.setDepositStatusFactory(depositStatusFactory);
setField(job, "depositModelManager", depositModelManager);
setField(job, "premisLoggerFactory", mockPremisLoggerFactory);
setField(job, "depositsDirectory", depositsDirectory);
setField(job, "pidMinter", pidMinter);
job.init();
mockPremisEventBuilder = mock(PremisEventBuilder.class, new SelfReturningAnswer());
when(mockPremisLoggerFactory.createPremisLogger(any(PID.class), any(File.class))).thenReturn(mockPremisLogger);
when(mockPremisLogger.buildEvent(any(Resource.class))).thenReturn(mockPremisEventBuilder);
model = job.getWritableModel();
depBag = model.createBag(depositPid.getRepositoryPath());
when(pidMinter.mintContentPid()).thenAnswer(new Answer<PID>() {
@Override
public PID answer(InvocationOnMock invocation) throws Throwable {
return makePid(CONTENT_BASE);
}
});
}
Aggregations