### Question:
IngestContentObjectsJob extends AbstractDepositJob { private void ingestCollection(ContentContainerObject parent, Resource parentResc, Resource childResc) throws DepositException, IOException { PID childPid = PIDs.get(childResc.getURI()); CollectionObject obj = null; if (skipResumed(childResc)) { obj = repoObjLoader.getCollectionObject(childPid); } else { aclService.assertHasAccess( "Depositor does not have permissions to create collections in " + parent.getPid(), parent.getPid(), groupSet, Permission.createCollection); Model model = ModelFactory.createDefaultModel(); Resource collectionResc = model.getResource(childPid.getRepositoryPath()); populateAIPProperties(childResc, collectionResc); addAclProperties(childResc, collectionResc); FedoraTransaction tx = txManager.startTransaction(); try { obj = repoObjFactory.createCollectionObject(childPid, model); addIngestionEventForChild(obj); parent.addMember(obj); addDescription(obj, childResc); log.info("Created collection {} for deposit {}", childPid, getDepositPID()); } catch (Exception e) { tx.cancelAndIgnore(); throw e; } finally { tx.close(); } addClicks(1); getDepositStatusFactory().incrIngestedObjects(getDepositUUID(), 1); } ingestChildren(obj, childResc); if (isObjectCompleted(obj.getPid())) { FedoraTransaction txPremis = txManager.startTransaction(); try { addIngestionEventForContainer(obj, childResc); addPremisEvents(obj); overrideModifiedTimestamp(obj, childResc); } catch (Exception e) { txPremis.cancelAndIgnore(); throw e; } finally { txPremis.close(); } } } IngestContentObjectsJob();  IngestContentObjectsJob(String uuid, String depositUUID); @Override void runJob();  }### Answer:
@Test public void ingestCollectionTest() { destinationObj = mock(AdminUnit.class); when(destinationObj.getPid()).thenReturn(destinationPid); when(repoObjLoader.getRepositoryObject(eq(destinationPid))).thenReturn(destinationObj); CollectionObject collection = mock(CollectionObject.class); when(repoObjFactory.createCollectionObject(any(PID.class), any(Model.class))).thenReturn(collection); PID collectionPid = makePid(RepositoryPathConstants.CONTENT_BASE); Bag collectionBag = model.createBag(collectionPid.getRepositoryPath()); collectionBag.addProperty(RDF.type, Cdr.Collection); collectionBag.addProperty(CdrAcl.canViewOriginals, AUTHENTICATED_PRINC); when(collection.getPid()).thenReturn(collectionPid); depBag.add(collectionBag); job.closeModel(); job.run(); verify(repoObjFactory).createCollectionObject(eq(collectionPid), modelCaptor.capture()); verify(destinationObj).addMember(eq(collection)); verify(jobStatusFactory).incrCompletion(eq(jobUUID), eq(1)); Resource collAipResc = modelCaptor.getValue().getResource(collectionPid.getRepositoryPath()); assertTrue("Collection object did not contain assigned restriction", collAipResc.hasProperty(CdrAcl.canViewOriginals, AUTHENTICATED_PRINC)); }