### Question:
ArchivedCaseDocumentDatastore extends CommonDatastore<ArchivedCaseDocumentItem, ArchivedDocument> implements DatastoreHasGet<CaseDocumentItem>,
        DatastoreHasDelete { protected ItemSearchResult<ArchivedCaseDocumentItem> searchDocument(final int page, final int resultsByPage, final String search, final Map<String, String> filters, final String orders) { try { final APIID supervisorAPIID = APIID.makeAPIID(filters.get(ArchivedCaseDocumentItem.FILTER_SUPERVISOR_ID)); final APIID archivedCaseId = APIID.makeAPIID(filters.get(ArchivedCaseDocumentItem.FILTER_ARCHIVED_CASE_ID)); if (supervisorAPIID != null) { filters.remove(ArchivedCaseDocumentItem.FILTER_SUPERVISOR_ID); } if (archivedCaseId != null) { filters.remove(ArchivedCaseDocumentItem.FILTER_ARCHIVED_CASE_ID); final ArchivedProcessInstance archivedProcessInstance = processAPI.getArchivedProcessInstance(archivedCaseId.toLong()); if (archivedProcessInstance != null) { final Long sourceCaseId = archivedProcessInstance.getSourceObjectId(); filters.put(ArchivedCaseDocumentItem.ATTRIBUTE_CASE_ID, sourceCaseId.toString()); } } searchOptionsCreator = buildSearchOptionCreator(page, resultsByPage, search, filters, orders); final SearchResult<ArchivedDocument> engineSearchResults; if (supervisorAPIID != null) { engineSearchResults = processAPI.searchArchivedDocumentsSupervisedBy(supervisorAPIID.toLong(), searchOptionsCreator.create()); } else { engineSearchResults = processAPI.searchArchivedDocuments(searchOptionsCreator.create()); } return new ItemSearchResult<ArchivedCaseDocumentItem>(page, resultsByPage, engineSearchResults.getCount(), convertEngineToConsoleItem(engineSearchResults.getResult())); } catch (final ArchivedProcessInstanceNotFoundException e) { throw new APIException("archivedCaseId not found. Request with bad param value."); } catch (final UserNotFoundException e) { throw new APIException("supervisor_id not found. Request with bad param value."); } catch (final SearchException e) { throw new APIException("Error while searching."); } } 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_call_processAPI_searchDocuments_method() throws SearchException { when(processAPI.searchArchivedDocuments(any(SearchOptions.class))).thenReturn(mockedEngineSearchResults); final Map<String, String> filters = new HashMap<>(); filters.put("submittedBy", "1"); documentDatastore.searchDocument(0, 10, "hello", filters, "name ASC"); verify(processAPI).searchArchivedDocuments(documentDatastore.searchOptionsCreator.create()); }