### Question:
SolrOntologyHelperFactory { public OntologyHelper buildOntologyHelper() throws OntologyHelperException { return new OntologyHelperBuilder() .ontologyUri(params.get(ONTOLOGY_URI_PARAM)) .labelPropertyUris(params.getParams(LABEL_PROPERTIES)) .synonymPropertyUris(params.getParams(SYNONYM_PROPERTIES)) .definitionPropertyUris(params.getParams(DEFINITION_PROPERTIES)) .ignorePropertyUris(params.getParams(IGNORE_PROPERTIES)) .olsBaseUrl(params.get(OLS_BASE_URL)) .ontology(params.get(OLS_ONTOLOGY_NAME)) .pageSize(params.getInt(OLS_PAGE_SIZE, OLSOntologyHelper.PAGE_SIZE)) .threadpoolSize(params.getInt(OLS_THREADPOOL, OLSOntologyHelper.THREADPOOL_SIZE)) .threadFactory(new DefaultSolrThreadFactory("olsOntologyHelper")) .nodeLabelSeparator(params.get(NODE_LABEL_SEPARATOR_PARAM, OntologyHelperConfiguration.NODE_LABEL_SEPARATOR)) .nodePathSeparator(params.get(NODE_PATH_SEPARATOR_PARAM, OntologyHelperConfiguration.NODE_PATH_SEPARATOR)) .build(); } SolrOntologyHelperFactory(SolrParams params); OntologyHelper buildOntologyHelper(); static final String ONTOLOGY_URI_PARAM; static final String CONFIG_FILE_PARAM; static final String OLS_BASE_URL; static final String OLS_ONTOLOGY_NAME; static final String OLS_THREADPOOL; static final String OLS_PAGE_SIZE; static final String LABEL_PROPERTIES; static final String SYNONYM_PROPERTIES; static final String DEFINITION_PROPERTIES; static final String IGNORE_PROPERTIES; static final String NODE_PATH_SEPARATOR_PARAM; static final String NODE_LABEL_SEPARATOR_PARAM; }### Answer:
@Test public void construct_missingOLSOntology() throws Exception { Map<String, String> paramMap = new HashMap<>(); paramMap.put(SolrOntologyHelperFactory.OLS_BASE_URL, "http: SolrOntologyHelperFactory factory = new SolrOntologyHelperFactory(new MapSolrParams(paramMap)); OntologyHelper helper = factory.buildOntologyHelper(); assertTrue(helper instanceof OLSTermsOntologyHelper); }
@Test public void buildOntologyHelper_ols() throws Exception { Map<String, String> paramMap = new HashMap<>(); paramMap.put(SolrOntologyHelperFactory.OLS_BASE_URL, "http: paramMap.put(SolrOntologyHelperFactory.OLS_ONTOLOGY_NAME, "efo"); SolrOntologyHelperFactory factory = new SolrOntologyHelperFactory(new MapSolrParams(paramMap)); OntologyHelper helper = factory.buildOntologyHelper(); assertTrue(helper instanceof OLSOntologyHelper); }