use of com.b2international.snowowl.fhir.core.model.Issue.Builder in project snow-owl by b2ihealthcare.
the class LookupResultSerializationTest method missingDisplayTest.
@Test
public void missingDisplayTest() throws Exception {
Builder builder = Issue.builder().code(IssueType.INVALID).severity(IssueSeverity.ERROR).diagnostics("1 validation error");
Issue expectedIssue = builder.addLocation("LookupResult.display").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'display' content is invalid [null]. Violation: may not be empty.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
LookupResult.builder().name("name").build();
}
use of com.b2international.snowowl.fhir.core.model.Issue.Builder in project snow-owl by b2ihealthcare.
the class LookupResultSerializationTest method missingNameTest.
@Test
public void missingNameTest() 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 [null]. Violation: may not be empty.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
LookupResult.builder().display("display").build();
}
use of com.b2international.snowowl.fhir.core.model.Issue.Builder in project snow-owl by b2ihealthcare.
the class LookupRequestDeserializationTest 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));
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 missingValueTest.
@Test
public void missingValueTest() 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 [null]. Violation: may not be empty.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
Designation.builder().build();
}
use of com.b2international.snowowl.fhir.core.model.Issue.Builder in project snow-owl by b2ihealthcare.
the class ValidateCodeSystemCodeRequestTest method multipleCodesTest.
@Test
public void multipleCodesTest() {
Builder builder = Issue.builder().code(IssueType.INVALID).severity(IssueSeverity.ERROR).diagnostics("1 validation error");
Issue expectedIssue = builder.addLocation("ValidateCodeRequest.tooManyCodesDefined").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'tooManyCodesDefined' content is invalid [false]." + " Violation: Either code, coding or codeable can be defined at a time.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
ValidateCodeRequest.builder().code("B").url("systemURI").coding(Coding.builder().code("A").system("systemURI").build()).build();
}