Skip to content

Commit

Permalink
MAT-7030: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chubert-sb committed Jun 5, 2024
1 parent fecafbc commit 64c83a5
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/test/java/gov/cms/madie/util/ElmDependencyUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import java.util.Collections;
import java.util.List;
import java.util.Map;

import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.MatcherAssert.assertThat;
Expand All @@ -18,11 +19,23 @@ class ElmDependencyUtilTest implements ResourceFileUtil {
void findDependencies() throws Exception {
String elms = getStringFromTestResource("/elm/libraryElm.json");
String elms2 = getStringFromTestResource("/elm/libraryElm2.json");
List<StatementDependency> dependencies =
Map<String, List<StatementDependency>> libraries =
ElmDependencyUtil.findDependencies(
List.of(elms, elms2), "UrinarySymptomScoreChangeAfterBenignProstaticHyperplasia");

assertEquals(25, dependencies.size());
assertEquals(2, libraries.size());
assertEquals(
25, libraries.get("UrinarySymptomScoreChangeAfterBenignProstaticHyperplasia").size());
assertEquals(4, libraries.get("MATGlobalCommonFunctionsQDM").size());
assertEquals(
2,
libraries.get("MATGlobalCommonFunctionsQDM").stream()
.filter(
statementDependency -> statementDependency.getStatement_name().equals("EarliestOf"))
.findFirst()
.get()
.getStatement_references()
.size());
}

@Test
Expand Down

0 comments on commit 64c83a5

Please sign in to comment.