use of com.b2international.snowowl.fhir.core.model.Issue.Builder 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.Builder 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.Builder 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.Builder in project snow-owl by b2ihealthcare.
the class DesignationSerializationTest method emptyValueTest.
@Test
public void emptyValueTest() throws Exception {
Builder builder = Issue.builder().code(IssueType.INVALID).severity(IssueSeverity.ERROR).diagnostics("1 validation error");
Issue expectedIssue = builder.addLocation("Designation.value").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'value' content is invalid []. Violation: may not be empty.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
Designation.builder().value("").build();
}
use of com.b2international.snowowl.fhir.core.model.Issue.Builder in project snow-owl by b2ihealthcare.
the class LookupResultSerializationTest method emptyNameTest.
@Test
public void emptyNameTest() throws Exception {
Builder builder = Issue.builder().code(IssueType.INVALID).severity(IssueSeverity.ERROR).diagnostics("1 validation error");
Issue expectedIssue = builder.addLocation("LookupResult.name").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'name' content is invalid []. Violation: may not be empty.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
LookupResult.builder().display("display").name("").build();
}