use of com.b2international.snowowl.fhir.core.model.Issue in project snow-owl by b2ihealthcare.
the class ValidateCodeSystemCodeRequestTest method missingCodeTest.
@Test
public void missingCodeTest() {
Builder builder = Issue.builder().code(IssueType.INVALID).severity(IssueSeverity.ERROR).diagnostics("1 validation error");
Issue expectedIssue = builder.addLocation("ValidateCodeRequest.codeMissing").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'codeMissing' content is invalid [false]." + " Violation: No code is provided to validate.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
ValidateCodeRequest.builder().build();
}
use of com.b2international.snowowl.fhir.core.model.Issue in project snow-owl by b2ihealthcare.
the class ValidateCodeSystemCodeRequestTest method missingCodeWithDisplayTest.
@Test
public void missingCodeWithDisplayTest() {
Builder builder = Issue.builder().code(IssueType.INVALID).severity(IssueSeverity.ERROR).diagnostics("1 validation error");
Issue expectedIssue = builder.addLocation("ValidateCodeRequest.codeProvidedWithDisplay").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'codeProvidedWithDisplay' content is invalid [false]." + " Violation: Code is missing while display is provided.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
ValidateCodeRequest.builder().display("TermA").url("systemURI").coding(Coding.builder().code("A").system("systemURI").build()).build();
}
use of com.b2international.snowowl.fhir.core.model.Issue in project snow-owl by b2ihealthcare.
the class TranslateRequestDeserializationTest method invalidSourceTest.
@Test
public void invalidSourceTest() {
Issue expectedIssue = Issue.builder().code(IssueType.INVALID).severity(IssueSeverity.ERROR).diagnostics("1 validation error").addLocation("TranslateRequest.sourceValid").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'sourceValid' content is invalid [false]. " + "Violation: Source needs to be set either via code/system or code or codeable concept.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
Coding coding = Coding.builder().system("http://hl7.org/fhir/issue-severity").code("fatal").build();
TranslateRequest.builder().code("fatal").system("http://hl7.org/fhir/issue-severity").version("3.0.1").coding(coding).target("http://target.codesystem.uri").build();
}
use of com.b2international.snowowl.fhir.core.model.Issue in project snow-owl by b2ihealthcare.
the class ExpandValueSetRequestDeserializationTest method missingCodeTest.
// @Test
public void missingCodeTest() {
Builder builder = Issue.builder().code(IssueType.INVALID).severity(IssueSeverity.ERROR).diagnostics("1 validation error");
Issue expectedIssue = builder.addLocation("LookupRequest.codeMissing").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'codeMissing' content is invalid [false]." + " Violation: Code is not provided for the system.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
System.out.println("Building the lookup request object.");
LookupRequest.builder().system("system").build();
}
use of com.b2international.snowowl.fhir.core.model.Issue in project snow-owl by b2ihealthcare.
the class NarrativeTest method invalidNarrative.
@Test
public void invalidNarrative() throws Exception {
Issue expectedIssue = validationErrorIssueBuilder.addLocation("Narrative.div").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'div' content is invalid [<div>]. Violation: div content is invalid, minimally should be <div></div>.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
Narrative.builder().div("<div>").status(NarrativeStatus.GENERATED).build();
}
Aggregations