### Question:
IngestContentObjectsJob extends AbstractDepositJob { private void ingestAdminUnit(ContentContainerObject parent, Resource parentResc, Resource childResc) throws DepositException, IOException { PID childPid = PIDs.get(childResc.getURI()); AdminUnit obj = null; if (skipResumed(childResc)) { obj = repoObjLoader.getAdminUnit(childPid); } else { aclService.assertHasAccess( "Depositor does not have permissions to create admin units", parent.getPid(), groupSet, Permission.createAdminUnit); Model model = ModelFactory.createDefaultModel(); Resource adminResc = model.getResource(childPid.getRepositoryPath()); populateAIPProperties(childResc, adminResc); addAclProperties(childResc, adminResc); FedoraTransaction tx = txManager.startTransaction(); try { obj = repoObjFactory.createAdminUnit(childPid, model); addIngestionEventForChild(obj); parent.addMember(obj); addDescription(obj, childResc); log.info("Created admin unit {} 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 ingestAdminUnitTest() { destinationObj = mock(ContentRootObject.class); when(destinationObj.getPid()).thenReturn(destinationPid); when(repoObjLoader.getRepositoryObject(eq(destinationPid))).thenReturn(destinationObj); AdminUnit adminUnit = mock(AdminUnit.class); when(repoObjFactory.createAdminUnit(any(PID.class), any(Model.class))).thenReturn(adminUnit); PID adminPid = makePid(RepositoryPathConstants.CONTENT_BASE); Bag adminBag = model.createBag(adminPid.getRepositoryPath()); adminBag.addProperty(RDF.type, Cdr.AdminUnit); adminBag.addProperty(CdrAcl.canManage, "staff"); when(adminUnit.getPid()).thenReturn(adminPid); depBag.add(adminBag); job.closeModel(); job.run(); verify(repoObjFactory).createAdminUnit(eq(adminPid), modelCaptor.capture()); verify(destinationObj).addMember(eq(adminUnit)); verify(jobStatusFactory).incrCompletion(eq(jobUUID), eq(1)); Resource adminAipResc = modelCaptor.getValue().getResource(adminPid.getRepositoryPath()); assertTrue("Admin object did not contain assigned restriction", adminAipResc.hasProperty(CdrAcl.canManage)); }