Skip to content

Commit

Permalink
add concept.defaultConceptMapType GP for the value set translator test
Browse files Browse the repository at this point in the history
  • Loading branch information
mherman22 committed Apr 21, 2024
1 parent 2960413 commit c76a513
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ private FhirConstants() {
public static final String GLOBAL_PROPERTY_MODERATE = "allergy.concept.severity.moderate";

public static final String GLOBAL_PROPERTY_OTHER = "allergy.concept.severity.other";


public static final String GLOBAL_PROPERTY_DEFAULT_CONCEPT_MAP_TYPE = "concept.defaultConceptMapType";

public static final String GLOBAL_PROPERTY_URI_PREFIX = "fhir2.uriPrefix";

public static final String ENCOUNTER_REFERENCE_SEARCH_HANDLER = "encounter.reference.search.handler";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import static org.hamcrest.Matchers.notNullValue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.openmrs.module.fhir2.FhirConstants.GLOBAL_PROPERTY_DEFAULT_CONCEPT_MAP_TYPE;

import java.util.ArrayList;
import java.util.Collection;
Expand All @@ -36,8 +37,10 @@
import org.openmrs.module.fhir2.FhirTestConstants;
import org.openmrs.module.fhir2.TestFhirSpringConfiguration;
import org.openmrs.module.fhir2.api.FhirConceptSourceService;
import org.openmrs.module.fhir2.api.FhirGlobalPropertyService;
import org.openmrs.module.fhir2.model.FhirConceptSource;
import org.openmrs.test.BaseModuleContextSensitiveTest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;

@ContextConfiguration(classes = TestFhirSpringConfiguration.class, inheritLocations = false)
Expand All @@ -50,13 +53,21 @@ public class ValueSetTranslatorImplTest extends BaseModuleContextSensitiveTest {

@Mock
private Concept concept;

@Autowired
private FhirGlobalPropertyService globalPropertyService;

private final ValueSetTranslatorImpl valueSetTranslator = new ValueSetTranslatorImpl();

@Before
public void setup() {
valueSetTranslator.setConceptSourceService(conceptSourceService);
}

@Before
public void setGlobalProperty() {
when(globalPropertyService.getGlobalProperty(GLOBAL_PROPERTY_DEFAULT_CONCEPT_MAP_TYPE)).thenReturn("NARROWER-THAN");
}

@Test
public void shouldTranslateConceptSetToValueSet() {
Expand Down

0 comments on commit c76a513

Please sign in to comment.