Skip to content

Commit 9a08319

Browse files
NIAD-1136: Remove lenient mocking from ConditionLinkSetMapperTests (#1408)
* Remove lenient stubbing from `ConditionLinkSetMapper` * Refactor `ConditionLinkSetMapper` to remove lenient stubbing. * Inline single use constants. * Move shared stubbing to reusable methods. * Regroup / extract tests from parameterized tests which relied on lenient mocking. * Move condition tests code to `CodeableConceptMapperMockUtil`. * * Update test files so that they use real examples, as previously the same ID was being provided for conditions and the actual problem observation. * Remove duplicated tests / test files when inputs and expected outputs were the same.
1 parent 7056051 commit 9a08319

37 files changed

+289
-360
lines changed

service/src/test/java/uk/nhs/adaptors/gp2gp/ehr/mapper/ConditionLinkSetMapperTest.java

Lines changed: 197 additions & 188 deletions
Large diffs are not rendered by default.

service/src/test/java/uk/nhs/adaptors/gp2gp/utils/CodeableConceptMapperMockUtil.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ public class CodeableConceptMapperMockUtil {
44
public static final String NULL_FLAVOR_CODE = "<code nullFlavor=\"UNK\"><originalText>Mocked code</originalText></code>";
55
public static final String ACTUAL_PROBLEM_CODE =
66
"<code code=\"55607006\" codeSystem=\"2.16.840.1.113883.2.1.3.2.4.15\" displayName=\"Problem\">";
7+
public static final String TEST_CONDITION_CODE =
8+
"<code code=\"55607006\" codeSystem=\"2.16.840.1.113883.2.1.3.2.4.15\" displayName=\"Problem\">"
9+
+ "<originalText>Test Condition</originalText></code>";
10+
711
}

service/src/test/resources/ehr/mapper/condition/condition_2_related_clinical_content.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{
1111
"url": "https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-ActualProblem-1",
1212
"valueReference": {
13-
"reference": "Observation/7E277DF1-6F1C-47CD-84F7-E9B7BF4105DB"
13+
"reference": "Observation/CDF96FF9-267A-41F7-93A1-BEBDCDEC2B98"
1414
}
1515
},
1616
{

service/src/test/resources/ehr/mapper/condition/condition_all_included.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{
1111
"url": "https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-ActualProblem-1",
1212
"valueReference": {
13-
"reference": "Observation/7E277DF1-6F1C-47CD-84F7-E9B7BF4105DB"
13+
"reference": "Observation/CDF96FF9-267A-41F7-93A1-BEBDCDEC2B98"
1414
}
1515
},
1616
{

service/src/test/resources/ehr/mapper/condition/condition_asserter_not_practitioner.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{
1111
"url": "https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-ActualProblem-1",
1212
"valueReference": {
13-
"reference": "Observation/7E277DF1-6F1C-47CD-84F7-E9B7BF4105DB"
13+
"reference": "Observation/CDF96FF9-267A-41F7-93A1-BEBDCDEC2B98"
1414
}
1515
},
1616
{

service/src/test/resources/ehr/mapper/condition/condition_asserter_not_present.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{
1111
"url": "https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-ActualProblem-1",
1212
"valueReference": {
13-
"reference": "Observation/7E277DF1-6F1C-47CD-84F7-E9B7BF4105DB"
13+
"reference": "Observation/CDF96FF9-267A-41F7-93A1-BEBDCDEC2B98"
1414
}
1515
},
1616
{

service/src/test/resources/ehr/mapper/condition/condition_dates_not_present.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{
1111
"url": "https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-ActualProblem-1",
1212
"valueReference": {
13-
"reference": "Observation/7E277DF1-6F1C-47CD-84F7-E9B7BF4105DB"
13+
"reference": "Observation/CDF96FF9-267A-41F7-93A1-BEBDCDEC2B98"
1414
}
1515
},
1616
{

service/src/test/resources/ehr/mapper/condition/condition_dates_present.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{
1111
"url": "https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-ActualProblem-1",
1212
"valueReference": {
13-
"reference": "Observation/7E277DF1-6F1C-47CD-84F7-E9B7BF4105DB"
13+
"reference": "Observation/CDF96FF9-267A-41F7-93A1-BEBDCDEC2B98"
1414
}
1515
},
1616
{

service/src/test/resources/ehr/mapper/condition/condition_major_significance.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{
1111
"url": "https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-ActualProblem-1",
1212
"valueReference": {
13-
"reference": "Observation/7E277DF1-6F1C-47CD-84F7-E9B7BF4105DB"
13+
"reference": "Observation/CDF96FF9-267A-41F7-93A1-BEBDCDEC2B98"
1414
}
1515
},
1616
{

service/src/test/resources/ehr/mapper/condition/condition_no_related_clinical_content.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{
1111
"url": "https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-ActualProblem-1",
1212
"valueReference": {
13-
"reference": "Observation/7E277DF1-6F1C-47CD-84F7-E9B7BF4105DB"
13+
"reference": "Observation/CDF96FF9-267A-41F7-93A1-BEBDCDEC2B98"
1414
}
1515
},
1616
{

0 commit comments

Comments
 (0)