use of org.openmrs.ConceptStopWord in project openmrs-core by openmrs.
the class ConceptServiceTest method saveConceptStopWord_shouldFailIfADuplicateConceptStopWordInALocaleIsAdded.
/**
* @see ConceptService#saveConceptStopWord(ConceptStopWord)
*/
@Test(expected = ConceptStopWordException.class)
public void saveConceptStopWord_shouldFailIfADuplicateConceptStopWordInALocaleIsAdded() {
ConceptStopWord conceptStopWord = new ConceptStopWord("A");
try {
conceptService.saveConceptStopWord(conceptStopWord);
conceptService.saveConceptStopWord(conceptStopWord);
} catch (ConceptStopWordException e) {
assertEquals("ConceptStopWord.duplicated", e.getMessage());
throw e;
}
}
use of org.openmrs.ConceptStopWord in project openmrs-core by openmrs.
the class ConceptServiceTest method getConcepts_shouldReturnASearchResultForPhraseWithStopWords.
/**
* @see ConceptService#getConcepts(String, List, boolean, List, List, List, List, Concept, Integer, Integer)
*/
@Test
public void getConcepts_shouldReturnASearchResultForPhraseWithStopWords() {
executeDataSet("org/openmrs/api/include/ConceptServiceTest-names.xml");
conceptService.saveConceptStopWord(new ConceptStopWord("OF", Locale.US));
List<ConceptSearchResult> searchResults = conceptService.getConcepts("tuberculosis of knee", Collections.singletonList(new Locale("en", "US")), false, null, null, null, null, null, null, null);
Assert.assertEquals(1, searchResults.size());
Assert.assertEquals("Tuberculosis of Knee", searchResults.get(0).getConceptName().getName());
}
Aggregations