### Question:
DepositSubmissionService { public PID submitDeposit(PID destPid, DepositData deposit) throws DepositException { aclService.assertHasAccess("Insufficient permissions to deposit to " + destPid.getRepositoryPath(), destPid, deposit.getDepositingAgent().getPrincipals(), Permission.ingest); PackagingType type = deposit.getPackagingType(); DepositHandler depositHandler = packageHandlers.get(type); if (type == null || depositHandler == null) { throw new UnsupportedPackagingTypeException("Cannot perform deposit of type " + type); } return depositHandler.doDeposit(destPid, deposit); }  PID submitDeposit(PID destPid, DepositData deposit); void setPackageHandlers(Map<PackagingType, DepositHandler> packageHandlers); void setAclService(AccessControlService aclService);  }### Answer:
@Test public void testSubmitDepositSimplePackage() throws Exception { DepositData deposit = new DepositData(FILEPATH.toUri(), MIMETYPE, PackagingType.SIMPLE_OBJECT, DEPOSIT_METHOD, depositingAgent); depositService.submitDeposit(depositPid, deposit); verify(depositHandler1).doDeposit(depositPid, deposit); }
@Test public void testSubmitDepositBagitPackage() throws Exception { DepositData deposit = new DepositData(FILEPATH.toUri(), MIMETYPE, PackagingType.BAGIT, DEPOSIT_METHOD, depositingAgent); depositService.submitDeposit(depositPid, deposit); verify(depositHandler2).doDeposit(depositPid, deposit); }
@Test(expected = UnsupportedPackagingTypeException.class) public void testSubmitDepositUnregisteredPackage() throws Exception { DepositData deposit = new DepositData(FILEPATH.toUri(), MIMETYPE, PackagingType.ATOM, DEPOSIT_METHOD, depositingAgent); depositService.submitDeposit(depositPid, deposit); }
@Test(expected = UnsupportedPackagingTypeException.class) public void testSubmitDepositNullPackage() throws Exception { DepositData deposit = new DepositData(FILEPATH.toUri(), MIMETYPE, null, DEPOSIT_METHOD, depositingAgent); depositService.submitDeposit(depositPid, deposit); }