### Question:
ProcessConnectorDatastore extends CommonDatastore<ProcessConnectorItem, ConnectorImplementationDescriptor> implements
        DatastoreHasGet<ProcessConnectorItem>,
        DatastoreHasSearch<ProcessConnectorItem> { @Override public ItemSearchResult<ProcessConnectorItem> search(final int page, final int resultsByPage, final String search, final String orders, final Map<String, String> filters) { try { final Long processId = MapUtil.getValueAsLong(filters, ATTRIBUTE_PROCESS_ID); final List<ConnectorImplementationDescriptor> connectors = getProcessAPI().getConnectorImplementations( processId, SearchOptionsBuilderUtil.computeIndex(page, resultsByPage), resultsByPage, ConnectorCriterion.valueOf(orders.toUpperCase().replace(" ", "_"))); final List<ProcessConnectorItem> results = new ArrayList<ProcessConnectorItem>(); for (final ConnectorImplementationDescriptor connector : connectors) { final ProcessConnectorItem result = convertEngineToConsoleItem(connector); result.setProcessId(processId); results.add(result); } final long numtotalConnectorImplem = getProcessAPI().getNumberOfConnectorImplementations(processId); return new ItemSearchResult<ProcessConnectorItem>(page, resultsByPage, numtotalConnectorImplem, results); } catch (final Exception e) { throw new APIException(e); } } ProcessConnectorDatastore(final APISession engineSession); @Override ProcessConnectorItem get(final APIID id); @Override ItemSearchResult<ProcessConnectorItem> search(final int page, final int resultsByPage, final String search, final String orders,
            final Map<String, String> filters);  }### Answer:
@Test(expected = APIException.class) public void searchThrowExceptionIfProcessDefinitionIsNotFound() throws Exception { when(this.processAPI.getConnectorImplementations(anyLong(), anyInt(), anyInt(), any(ConnectorCriterion.class))) .thenThrow(new NullPointerException()); this.processConnectorDatastore.search(0, 10, null, null, aProcessIdFilter("1")); }