### Question:
CaseDocumentDatastore extends CommonDatastore<CaseDocumentItem, Document> implements DatastoreHasAdd<CaseDocumentItem>,
DatastoreHasGet<CaseDocumentItem>,
DatastoreHasUpdate<CaseDocumentItem>, DatastoreHasDelete { @Override public CaseDocumentItem get(final APIID id) { try { final Document documentItem = processAPI.getDocument(id.toLong()); return convertEngineToConsoleItem(documentItem); } catch (final Exception e) { throw new APIException(e); } } CaseDocumentDatastore(final APISession engineSession, final WebBonitaConstantsUtils constantsValue, final ProcessAPI processAPI,
            final BonitaHomeFolderAccessor tenantFolder); @Override CaseDocumentItem get(final APIID id); @Override CaseDocumentItem add(final CaseDocumentItem item); @Override CaseDocumentItem update(final APIID id, final Map<String, String> attributes); ItemSearchResult<CaseDocumentItem> 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_call_engine_processAPI_getDocument() throws Exception { final APIID id = APIID.makeAPIID(1l); documentDatastore.get(id); verify(processAPI).getDocument(id.toLong()); }
@Test(expected = APIException.class) public void it_should_catch_and_throw_APIException_for_not_find_document() throws Exception { final APIID id = APIID.makeAPIID(1l); when(processAPI.getDocument(id.toLong())).thenThrow(new DocumentNotFoundException("not found", new Exception())); documentDatastore.get(id); }