### Question:
ConnectorInstanceDatastore extends CommonDatastore<ConnectorInstanceItem, ConnectorInstance> implements DatastoreHasSearch<ConnectorInstanceItem> { @Override public ItemSearchResult<ConnectorInstanceItem> search(final int page, final int resultsByPage, final String search, final String orders, final Map<String, String> filters) { SearchResult<ConnectorInstance> searchConnectorInstances; try { searchConnectorInstances = getProcessAPI().searchConnectorInstances(buildSearchOptions(page, resultsByPage, search, orders, filters)); } catch (final Exception e) { throw new APIException(e); } if (searchConnectorInstances != null) { final List<ConnectorInstanceItem> convertedResult = convertEngineItemsIntoConsoleItems(searchConnectorInstances.getResult()); return new ItemSearchResult<ConnectorInstanceItem>(page, resultsByPage, searchConnectorInstances.getCount(), convertedResult); } else { throw new APIException("Search failed for the following parameters <page: " + page + " - resulsByPage: " + resultsByPage + " - search: " + search + " - filters: " + filters + " - orders: " + orders + ">"); } } ConnectorInstanceDatastore(final APISession engineSession); @Override ItemSearchResult<ConnectorInstanceItem> search(final int page, final int resultsByPage, final String search, final String orders,
            final Map<String, String> filters);  }### Answer:
@Test public void searchReturnAllItems() throws Exception { final ConnectorInstance connectorInstance1 = createConnectorInstanceImpl(1L, "instance 1"); final ConnectorInstance connectorInstance2 = createConnectorInstanceImpl(1L, "instance 2"); final SearchResult<ConnectorInstance> expected = new SearchResultImpl<ConnectorInstance>(2, Arrays.asList(connectorInstance1, connectorInstance2)); Mockito.when(this.mockedProcessAPI.searchConnectorInstances(Mockito.any(SearchOptions.class))).thenReturn(expected); final ItemSearchResult<ConnectorInstanceItem> searchResult = this.spiedDatastore.search(0, 10, null, null, new HashMap<String, String>()); Mockito.verify(this.mockedProcessAPI).searchConnectorInstances(Mockito.any(SearchOptions.class)); Assert.assertTrue(areEquals(new ConnectorInstanceItemWrapper(expected.getResult().get(0)), searchResult.getResults().get(0))); Assert.assertTrue(areEquals(new ConnectorInstanceItemWrapper(expected.getResult().get(1)), searchResult.getResults().get(1))); }