diff --git a/src/main/java/gov/cms/madie/util/MappingUtil.java b/src/main/java/gov/cms/madie/util/MappingUtil.java index cfd5195..7c047cd 100644 --- a/src/main/java/gov/cms/madie/util/MappingUtil.java +++ b/src/main/java/gov/cms/madie/util/MappingUtil.java @@ -70,7 +70,7 @@ public static String getPopulationDescription(Measure measure, PopulationType po .name() .equalsIgnoreCase(population.getName().name()) && StringUtils.isNotBlank(population.getDescription())) - .map(p -> p.getDefinition().replaceAll("[\\t\\n\\r]+", " ")) + .map(p -> p.getDescription().replaceAll("[\\t\\n\\r]+", " ")) .collect(Collectors.joining(" ")); } else if (CollectionUtils.isNotEmpty(group.getMeasureObservations()) && isPopulationObservation(populationType)) { @@ -81,7 +81,7 @@ && isPopulationObservation(populationType)) { observation -> StringUtils.isNotBlank(observation.getDefinition()) && StringUtils.isNotBlank(observation.getDescription())) - .map(mo -> mo.getDefinition().replaceAll("[\\t\\n\\r]+", " ")) + .map(mo -> mo.getDescription().replaceAll("[\\t\\n\\r]+", " ")) .collect(Collectors.joining(" ")); } return null; diff --git a/src/test/java/gov/cms/madie/resources/PackageControllerMvcTest.java b/src/test/java/gov/cms/madie/resources/PackageControllerMvcTest.java index 7b95e15..3ca1513 100644 --- a/src/test/java/gov/cms/madie/resources/PackageControllerMvcTest.java +++ b/src/test/java/gov/cms/madie/resources/PackageControllerMvcTest.java @@ -7,6 +7,7 @@ import gov.cms.madie.models.measure.Measure; import gov.cms.madie.packaging.utils.ResourceFileUtil; import gov.cms.madie.services.SimpleXmlService; +import gov.cms.madie.services.TranslationServiceClient; import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; @@ -35,6 +36,7 @@ class PackageControllerMvcTest implements ResourceFileUtil { @MockBean private PackagingService packagingService; @MockBean private SimpleXmlService simpleXmlService; @MockBean private HqmfService hqmfService; + @MockBean private TranslationServiceClient translationServiceClient; @Autowired private MockMvc mockMvc; private static final String TEST_USER_ID = "john_doe"; @@ -83,6 +85,8 @@ void testGetMeasureSimpleXml() throws Exception { String measureJson = getStringFromTestResource("/measures/qdm-test-measure.json"); Mockito.when(simpleXmlService.measureToSimpleXml(any(QdmMeasure.class), any(CqlLookups.class))) .thenReturn(""); + Mockito.when(translationServiceClient.getCqlLookups(any(QdmMeasure.class), anyString())) + .thenReturn(CqlLookups.builder().build()); mockMvc .perform( MockMvcRequestBuilders.put("/qdm/measures/simple-xml") @@ -95,6 +99,8 @@ void testGetMeasureSimpleXml() throws Exception { .andReturn(); verify(simpleXmlService, times(1)) .measureToSimpleXml(any(QdmMeasure.class), any(CqlLookups.class)); + verify(translationServiceClient, times(1)) + .getCqlLookups(any(QdmMeasure.class), anyString()); } @Test diff --git a/src/test/java/gov/cms/madie/util/MappingUtilTest.java b/src/test/java/gov/cms/madie/util/MappingUtilTest.java index 36198e2..db367da 100644 --- a/src/test/java/gov/cms/madie/util/MappingUtilTest.java +++ b/src/test/java/gov/cms/madie/util/MappingUtilTest.java @@ -239,7 +239,7 @@ void getPopulationDescriptionGroupTwoDescription() { .build(); String output = MappingUtil.getPopulationDescription(measure, PopulationType.INITIAL_POPULATION); - assertThat(output, equalTo("IP Description\nIPG2 Description")); + assertThat(output, equalTo("IP Description IPG2 Description")); } @Test @@ -356,6 +356,6 @@ void getPopulationDescriptionGroupMultipleDescriptions() { assertThat( output, equalTo( - "Denominator Obs Description\nNumerator Obs Description\nG2 Denominator Obs Description\nG2 Numerator Obs Description")); + "Denominator Obs Description Numerator Obs Description G2 Denominator Obs Description G2 Numerator Obs Description")); } }