### Question:
CaseDocumentDatastore extends CommonDatastore<CaseDocumentItem, Document> implements DatastoreHasAdd<CaseDocumentItem>,
DatastoreHasGet<CaseDocumentItem>,
DatastoreHasUpdate<CaseDocumentItem>, DatastoreHasDelete { protected ItemSearchResult<CaseDocumentItem> 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(CaseDocumentItem.FILTER_SUPERVISOR_ID)); if (supervisorAPIID != null) { filters.remove(CaseDocumentItem.FILTER_SUPERVISOR_ID); } searchOptionsCreator = buildSearchOptionCreator(page, resultsByPage, search, filters, orders); final SearchResult<Document> engineSearchResults; if (supervisorAPIID != null) { engineSearchResults = processAPI.searchDocumentsSupervisedBy(supervisorAPIID.toLong(), searchOptionsCreator.create()); } else { engineSearchResults = processAPI.searchDocuments(searchOptionsCreator.create()); } return new ItemSearchResult<CaseDocumentItem>(page, resultsByPage, engineSearchResults.getCount(), convertEngineToConsoleItem(engineSearchResults.getResult())); } catch (final Exception e) { e.printStackTrace(); } return null; } 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_processAPI_searchDocuments_method() throws SearchException { when(processAPI.searchDocuments(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).searchDocuments(documentDatastore.searchOptionsCreator.create()); }