use of com.b2international.snowowl.fhir.core.model.Issue in project snow-owl by b2ihealthcare.
the class CodingTest method buildWithInvalidSystem.
@Test
public void buildWithInvalidSystem() throws Exception {
Issue expectedIssue = validationErrorIssueBuilder.addLocation("Coding.system.uriValue").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'system.uriValue' content is invalid [sys tem]. Violation: uri is invalid.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
Coding.builder().code("1233").system("sys tem").version("20180131").build();
}
use of com.b2international.snowowl.fhir.core.model.Issue in project snow-owl by b2ihealthcare.
the class CodingTest method buildInvalidSnomedVersion.
@Test
public void buildInvalidSnomedVersion() throws Exception {
Issue expectedIssue = validationErrorIssueBuilder.addLocation("Coding.versionValid").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'versionValid' content is invalid [false]. " + "Violation: SNOMED CT version is defined as part of the system URI.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
Coding.builder().code("1234").system("http://snomed.info/sct").version("20180131").build();
}
use of com.b2international.snowowl.fhir.core.model.Issue in project snow-owl by b2ihealthcare.
the class BindingTest method buildInvalid.
@Test
public void buildInvalid() {
Issue expectedIssue = Issue.builder().code(IssueType.INVALID).severity(IssueSeverity.ERROR).diagnostics("1 validation error").addLocation("Binding.valid").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'valid' content is invalid [false]. Violation: Both URI and Reference cannot be set for the 'valueSet' property.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
binding = Binding.builder().id("id").description("bindingDescription").strength("strength").valueSetUri("valueSetUri").valueSetReference(Reference.builder().reference("reference").build()).build();
}
use of com.b2international.snowowl.fhir.core.model.Issue in project snow-owl by b2ihealthcare.
the class ExtensionTest method buildInvalid.
@Test
public void buildInvalid() {
ValidationException exception = assertThrows(ValidationException.class, () -> {
IntegerExtension.builder().url("ID").addExtension(IntegerExtension.builder().url("ID2").value(2).build()).value(1).build();
});
assertEquals("1 validation error", exception.getMessage());
Issue expectedIssue = validationErrorIssueBuilder.addLocation("IntegerExtension.valid").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'valid' content is invalid [false]. " + "Violation: An extension SHALL have either a value (i.e. a value[x] element) or sub-extensions.").build();
assertThat(exception, FhirExceptionIssueMatcher.issue(expectedIssue));
}
use of com.b2international.snowowl.fhir.core.model.Issue in project snow-owl by b2ihealthcare.
the class CodeSystemTest method buildCodeSystemWithNegativeCount.
@Test
public void buildCodeSystemWithNegativeCount() throws Exception {
Issue expectedIssue = Issue.builder().code(IssueType.INVALID).severity(IssueSeverity.ERROR).diagnostics("1 validation error").addLocation("CodeSystem.count").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'count' content is invalid [-1]. Violation: Count must be equal to or larger than 0.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
CodeSystem.builder().status(PublicationStatus.ACTIVE).content(CodeSystemContentMode.COMPLETE).count(-1).build();
}
Aggregations