### Question:
ArchivedCaseDocumentDatastore extends CommonDatastore<ArchivedCaseDocumentItem, ArchivedDocument> implements DatastoreHasGet<CaseDocumentItem>,
        DatastoreHasDelete { @Override public void delete(final List<APIID> ids) { if (ids != null) { try { for (final APIID id : ids) { processAPI.deleteContentOfArchivedDocument(id.toLong()); } } catch (final DocumentNotFoundException e) { throw new APIException("Error while deleting a document. Document not found"); } catch (final DocumentException e) { throw new APIException(e); } } else { throw new APIException("Error while deleting a document. Document id not specified in the request"); } } ArchivedCaseDocumentDatastore(final APISession engineSession, final WebBonitaConstantsUtils constantsValue, final ProcessAPI processAPI); @Override ArchivedCaseDocumentItem get(final APIID id); ItemSearchResult<ArchivedCaseDocumentItem> search(final int page, final int resultsByPage,
            final String search, final Map<String, String> filters, final String orders); @Override void delete(final List<APIID> ids);  }### Answer:
@Test public void it_should_delete_one_document() throws DocumentNotFoundException, DocumentException { final List<APIID> docs = new ArrayList<>(); docs.add(APIID.makeAPIID(mockedDocument.getId())); documentDatastore.delete(docs); verify(processAPI).deleteContentOfArchivedDocument(1L); verify(processAPI, times(1)).deleteContentOfArchivedDocument(any(Long.class)); }
@Test public void it_should_delete_two_documents() throws DocumentNotFoundException, DocumentException { final List<APIID> docs = new ArrayList<>(); docs.add(APIID.makeAPIID(mockedDocument.getId())); docs.add(APIID.makeAPIID(mockedDocument.getId())); documentDatastore.delete(docs); verify(processAPI, times(2)).deleteContentOfArchivedDocument(1L); }
@Test public void it_should_throw_an_exception_when_input_is_null() throws DocumentNotFoundException, DeletionException { expectedEx.expect(APIException.class); expectedEx.expectMessage("Error while deleting a document. Document id not specified in the request"); documentDatastore.delete(null); }