|
7 | 7 |
|
8 | 8 | import static com.ibm.fhir.model.type.String.string;
|
9 | 9 | import static org.testng.Assert.assertEquals;
|
| 10 | +import static org.testng.Assert.assertTrue; |
10 | 11 | import static org.testng.Assert.fail;
|
11 | 12 |
|
12 | 13 | import java.util.List;
|
@@ -119,8 +120,8 @@ public void testCreateWithNoProfileSpecified() throws Exception {
|
119 | 120 | // Validate results
|
120 | 121 | List<Issue> issues = e.getIssues();
|
121 | 122 | assertEquals(issues.size(), 1);
|
122 |
| - assertEquals(issues.get(0).getDetails().getText().getValue(), |
123 |
| - "A required profile was not specified. Resources of type 'Patient' must declare conformance to at least one of the following profiles: [profile1, profile2|1, profile3]"); |
| 123 | + assertTrue(issues.get(0).getDetails().getText().getValue().startsWith( |
| 124 | + "A required profile was not specified. Resources of type 'Patient' must declare conformance to at least one of the following profiles: [")); |
124 | 125 | assertEquals(issues.get(0).getSeverity(), IssueSeverity.ERROR);
|
125 | 126 | assertEquals(issues.get(0).getCode(), IssueType.BUSINESS_RULE);
|
126 | 127 | }
|
@@ -154,8 +155,8 @@ public void testCreateWithNonRequiredProfileSpecified() throws Exception {
|
154 | 155 | // Validate results
|
155 | 156 | List<Issue> issues = e.getIssues();
|
156 | 157 | assertEquals(issues.size(), 1);
|
157 |
| - assertEquals(issues.get(0).getDetails().getText().getValue(), |
158 |
| - "A required profile was not specified. Resources of type 'Patient' must declare conformance to at least one of the following profiles: [profile1, profile2|1, profile3]"); |
| 158 | + assertTrue(issues.get(0).getDetails().getText().getValue().startsWith( |
| 159 | + "A required profile was not specified. Resources of type 'Patient' must declare conformance to at least one of the following profiles: [")); |
159 | 160 | assertEquals(issues.get(0).getSeverity(), IssueSeverity.ERROR);
|
160 | 161 | assertEquals(issues.get(0).getCode(), IssueType.BUSINESS_RULE);
|
161 | 162 | }
|
@@ -189,8 +190,8 @@ public void testCreateWithRequiredProfileSpecifiedButNoVersion() throws Exceptio
|
189 | 190 | // Validate results
|
190 | 191 | List<Issue> issues = e.getIssues();
|
191 | 192 | assertEquals(issues.size(), 1);
|
192 |
| - assertEquals(issues.get(0).getDetails().getText().getValue(), |
193 |
| - "A required profile was not specified. Resources of type 'Patient' must declare conformance to at least one of the following profiles: [profile1, profile2|1, profile3]"); |
| 193 | + assertTrue(issues.get(0).getDetails().getText().getValue().startsWith( |
| 194 | + "A required profile was not specified. Resources of type 'Patient' must declare conformance to at least one of the following profiles: [")); |
194 | 195 | assertEquals(issues.get(0).getSeverity(), IssueSeverity.ERROR);
|
195 | 196 | assertEquals(issues.get(0).getCode(), IssueType.BUSINESS_RULE);
|
196 | 197 | }
|
@@ -514,8 +515,8 @@ public void testUpdateWithNoProfileSpecified() throws Exception {
|
514 | 515 | // Validate results
|
515 | 516 | List<Issue> issues = e.getIssues();
|
516 | 517 | assertEquals(issues.size(), 1);
|
517 |
| - assertEquals(issues.get(0).getDetails().getText().getValue(), |
518 |
| - "A required profile was not specified. Resources of type 'Patient' must declare conformance to at least one of the following profiles: [profile1, profile2|1, profile3]"); |
| 518 | + assertTrue(issues.get(0).getDetails().getText().getValue().startsWith( |
| 519 | + "A required profile was not specified. Resources of type 'Patient' must declare conformance to at least one of the following profiles: [")); |
519 | 520 | assertEquals(issues.get(0).getSeverity(), IssueSeverity.ERROR);
|
520 | 521 | assertEquals(issues.get(0).getCode(), IssueType.BUSINESS_RULE);
|
521 | 522 | }
|
@@ -550,8 +551,8 @@ public void testUpdateWithNonRequiredProfileSpecified() throws Exception {
|
550 | 551 | // Validate results
|
551 | 552 | List<Issue> issues = e.getIssues();
|
552 | 553 | assertEquals(issues.size(), 1);
|
553 |
| - assertEquals(issues.get(0).getDetails().getText().getValue(), |
554 |
| - "A required profile was not specified. Resources of type 'Patient' must declare conformance to at least one of the following profiles: [profile1, profile2|1, profile3]"); |
| 554 | + assertTrue(issues.get(0).getDetails().getText().getValue().startsWith( |
| 555 | + "A required profile was not specified. Resources of type 'Patient' must declare conformance to at least one of the following profiles: [")); |
555 | 556 | assertEquals(issues.get(0).getSeverity(), IssueSeverity.ERROR);
|
556 | 557 | assertEquals(issues.get(0).getCode(), IssueType.BUSINESS_RULE);
|
557 | 558 | }
|
@@ -666,8 +667,8 @@ public void testBundleWithNoProfileSpecified() throws Exception {
|
666 | 667 | assertEquals(issues.get(0).getDetails().getText().getValue(), "One or more errors were encountered while validating a 'transaction' request bundle.");
|
667 | 668 | assertEquals(issues.get(0).getSeverity(), IssueSeverity.FATAL);
|
668 | 669 | assertEquals(issues.get(0).getCode(), IssueType.INVALID);
|
669 |
| - assertEquals(issues.get(1).getDetails().getText().getValue(), |
670 |
| - "A required profile was not specified. Resources of type 'Patient' must declare conformance to at least one of the following profiles: [profile1, profile2|1, profile3]"); |
| 670 | + assertTrue(issues.get(1).getDetails().getText().getValue().startsWith( |
| 671 | + "A required profile was not specified. Resources of type 'Patient' must declare conformance to at least one of the following profiles: [")); |
671 | 672 | assertEquals(issues.get(1).getSeverity(), IssueSeverity.ERROR);
|
672 | 673 | assertEquals(issues.get(1).getCode(), IssueType.BUSINESS_RULE);
|
673 | 674 | }
|
@@ -719,8 +720,8 @@ public void testBundleWithNonRequiredProfileSpecified() throws Exception {
|
719 | 720 | assertEquals(issues.get(0).getDetails().getText().getValue(), "One or more errors were encountered while validating a 'transaction' request bundle.");
|
720 | 721 | assertEquals(issues.get(0).getSeverity(), IssueSeverity.FATAL);
|
721 | 722 | assertEquals(issues.get(0).getCode(), IssueType.INVALID);
|
722 |
| - assertEquals(issues.get(1).getDetails().getText().getValue(), |
723 |
| - "A required profile was not specified. Resources of type 'Patient' must declare conformance to at least one of the following profiles: [profile1, profile2|1, profile3]"); |
| 723 | + assertTrue(issues.get(1).getDetails().getText().getValue().startsWith( |
| 724 | + "A required profile was not specified. Resources of type 'Patient' must declare conformance to at least one of the following profiles: [")); |
724 | 725 | assertEquals(issues.get(1).getSeverity(), IssueSeverity.ERROR);
|
725 | 726 | assertEquals(issues.get(1).getCode(), IssueType.BUSINESS_RULE);
|
726 | 727 | }
|
@@ -852,8 +853,8 @@ public void testCreateWithNonAllowedProfileSpecified() throws Exception {
|
852 | 853 | // Validate results
|
853 | 854 | List<Issue> issues = e.getIssues();
|
854 | 855 | assertEquals(issues.size(), 1);
|
855 |
| - assertEquals(issues.get(0).getDetails().getText().getValue(), |
856 |
| - "A profile was specified which is not allowed. Resources of type 'CarePlan' are not allowed to declare conformance to any of the following profiles: [profile8, profile6|1]"); |
| 856 | + assertTrue(issues.get(0).getDetails().getText().getValue().startsWith( |
| 857 | + "A profile was specified which is not allowed. Resources of type 'CarePlan' are not allowed to declare conformance to any of the following profiles: [")); |
857 | 858 | assertEquals(issues.get(0).getSeverity(), IssueSeverity.ERROR);
|
858 | 859 | assertEquals(issues.get(0).getCode(), IssueType.BUSINESS_RULE);
|
859 | 860 | }
|
@@ -889,8 +890,8 @@ public void testCreateWithNonAllowedVersionedProfileSpecified() throws Exception
|
889 | 890 | // Validate results
|
890 | 891 | List<Issue> issues = e.getIssues();
|
891 | 892 | assertEquals(issues.size(), 1);
|
892 |
| - assertEquals(issues.get(0).getDetails().getText().getValue(), |
893 |
| - "A profile was specified which is not allowed. Resources of type 'CarePlan' are not allowed to declare conformance to any of the following profiles: [profile8, profile6|1]"); |
| 893 | + assertTrue(issues.get(0).getDetails().getText().getValue().startsWith( |
| 894 | + "A profile was specified which is not allowed. Resources of type 'CarePlan' are not allowed to declare conformance to any of the following profiles: [")); |
894 | 895 | assertEquals(issues.get(0).getSeverity(), IssueSeverity.ERROR);
|
895 | 896 | assertEquals(issues.get(0).getCode(), IssueType.BUSINESS_RULE);
|
896 | 897 | }
|
@@ -1019,8 +1020,8 @@ public void testUpdateWithNonAllowedProfileSpecified() throws Exception {
|
1019 | 1020 | // Validate results
|
1020 | 1021 | List<Issue> issues = e.getIssues();
|
1021 | 1022 | assertEquals(issues.size(), 1);
|
1022 |
| - assertEquals(issues.get(0).getDetails().getText().getValue(), |
1023 |
| - "A profile was specified which is not allowed. Resources of type 'CarePlan' are not allowed to declare conformance to any of the following profiles: [profile8, profile6|1]"); |
| 1023 | + assertTrue(issues.get(0).getDetails().getText().getValue().startsWith( |
| 1024 | + "A profile was specified which is not allowed. Resources of type 'CarePlan' are not allowed to declare conformance to any of the following profiles: [")); |
1024 | 1025 | assertEquals(issues.get(0).getSeverity(), IssueSeverity.ERROR);
|
1025 | 1026 | assertEquals(issues.get(0).getCode(), IssueType.BUSINESS_RULE);
|
1026 | 1027 | }
|
@@ -1057,8 +1058,8 @@ public void testUpdateWithNonAllowedVersionedProfileSpecified() throws Exception
|
1057 | 1058 | // Validate results
|
1058 | 1059 | List<Issue> issues = e.getIssues();
|
1059 | 1060 | assertEquals(issues.size(), 1);
|
1060 |
| - assertEquals(issues.get(0).getDetails().getText().getValue(), |
1061 |
| - "A profile was specified which is not allowed. Resources of type 'CarePlan' are not allowed to declare conformance to any of the following profiles: [profile8, profile6|1]"); |
| 1061 | + assertTrue(issues.get(0).getDetails().getText().getValue().startsWith( |
| 1062 | + "A profile was specified which is not allowed. Resources of type 'CarePlan' are not allowed to declare conformance to any of the following profiles: [")); |
1062 | 1063 | assertEquals(issues.get(0).getSeverity(), IssueSeverity.ERROR);
|
1063 | 1064 | assertEquals(issues.get(0).getCode(), IssueType.BUSINESS_RULE);
|
1064 | 1065 | }
|
@@ -1207,8 +1208,8 @@ public void testBundleWithNonAllowedProfileSpecified() throws Exception {
|
1207 | 1208 | assertEquals(issues.get(0).getDetails().getText().getValue(), "One or more errors were encountered while validating a 'transaction' request bundle.");
|
1208 | 1209 | assertEquals(issues.get(0).getSeverity(), IssueSeverity.FATAL);
|
1209 | 1210 | assertEquals(issues.get(0).getCode(), IssueType.INVALID);
|
1210 |
| - assertEquals(issues.get(1).getDetails().getText().getValue(), |
1211 |
| - "A profile was specified which is not allowed. Resources of type 'CarePlan' are not allowed to declare conformance to any of the following profiles: [profile8, profile6|1]"); |
| 1211 | + assertTrue(issues.get(1).getDetails().getText().getValue().startsWith( |
| 1212 | + "A profile was specified which is not allowed. Resources of type 'CarePlan' are not allowed to declare conformance to any of the following profiles: [")); |
1212 | 1213 | assertEquals(issues.get(1).getSeverity(), IssueSeverity.ERROR);
|
1213 | 1214 | assertEquals(issues.get(1).getCode(), IssueType.BUSINESS_RULE);
|
1214 | 1215 | }
|
@@ -1262,8 +1263,8 @@ public void testBundleWithNonAllowedVersionedProfileSpecified() throws Exception
|
1262 | 1263 | assertEquals(issues.get(0).getDetails().getText().getValue(), "One or more errors were encountered while validating a 'transaction' request bundle.");
|
1263 | 1264 | assertEquals(issues.get(0).getSeverity(), IssueSeverity.FATAL);
|
1264 | 1265 | assertEquals(issues.get(0).getCode(), IssueType.INVALID);
|
1265 |
| - assertEquals(issues.get(1).getDetails().getText().getValue(), |
1266 |
| - "A profile was specified which is not allowed. Resources of type 'CarePlan' are not allowed to declare conformance to any of the following profiles: [profile8, profile6|1]"); |
| 1266 | + assertTrue(issues.get(1).getDetails().getText().getValue().startsWith( |
| 1267 | + "A profile was specified which is not allowed. Resources of type 'CarePlan' are not allowed to declare conformance to any of the following profiles: [")); |
1267 | 1268 | assertEquals(issues.get(1).getSeverity(), IssueSeverity.ERROR);
|
1268 | 1269 | assertEquals(issues.get(1).getCode(), IssueType.BUSINESS_RULE);
|
1269 | 1270 | }
|
@@ -1445,8 +1446,8 @@ public void testCreateWithNonAllowedNonRequiredProfileSpecified() throws Excepti
|
1445 | 1446 | "A profile was specified which is not allowed. Resources of type 'Patient' are not allowed to declare conformance to any of the following profiles: [profile5]");
|
1446 | 1447 | assertEquals(issues.get(0).getSeverity(), IssueSeverity.ERROR);
|
1447 | 1448 | assertEquals(issues.get(0).getCode(), IssueType.BUSINESS_RULE);
|
1448 |
| - assertEquals(issues.get(1).getDetails().getText().getValue(), |
1449 |
| - "A required profile was not specified. Resources of type 'Patient' must declare conformance to at least one of the following profiles: [profile1, profile2|1, profile3]"); |
| 1449 | + assertTrue(issues.get(1).getDetails().getText().getValue().startsWith( |
| 1450 | + "A required profile was not specified. Resources of type 'Patient' must declare conformance to at least one of the following profiles: [")); |
1450 | 1451 | assertEquals(issues.get(1).getSeverity(), IssueSeverity.ERROR);
|
1451 | 1452 | assertEquals(issues.get(1).getCode(), IssueType.BUSINESS_RULE);
|
1452 | 1453 | }
|
|
0 commit comments