### Question:
ProcessConnectorDatastore extends CommonDatastore<ProcessConnectorItem, ConnectorImplementationDescriptor> implements
        DatastoreHasGet<ProcessConnectorItem>,
        DatastoreHasSearch<ProcessConnectorItem> { @Override public ProcessConnectorItem get(final APIID id) { try { final ProcessConnectorItem connector = convertEngineToConsoleItem( getProcessAPI().getConnectorImplementation( id.getPartAsLong(ATTRIBUTE_PROCESS_ID), id.getPart(ATTRIBUTE_NAME), id.getPart(ATTRIBUTE_VERSION) )); connector.setProcessId(id.getPartAsLong(ATTRIBUTE_PROCESS_ID)); return connector; } 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 public void getRetrieveConnectorImplementationAndSetProcessId() throws Exception { final ConnectorImplementationDescriptor descriptor = aConnectorImplementationDescriptor("aName"); when(this.processAPI.getConnectorImplementation(1L, "name", "1")).thenReturn(descriptor); final ProcessConnectorItem fetchedItem = this.processConnectorDatastore.get(anAPIID("1", "name", "1")); final ProcessConnectorItem expectedItem = convertToItem(descriptor, "1"); assertTrue(areEquals(expectedItem, fetchedItem)); }
@Test(expected = APIException.class) public void getThrowExceptionIfProcessDefinitionIsNotFound() throws Exception { when(this.processAPI.getConnectorImplementation(anyLong(), anyString(), anyString())) .thenThrow(new ConnectorNotFoundException(null)); this.processConnectorDatastore.get(anAPIID("1", "name", "1")); }