use of com.b2international.snowowl.fhir.core.model.Issue.Builder in project snow-owl by b2ihealthcare.
the class PropertySerializationTest method incorrectSubPropertyTest.
@Test
public void incorrectSubPropertyTest() throws Exception {
Builder builder = Issue.builder().code(IssueType.INVALID).severity(IssueSeverity.ERROR).diagnostics("1 validation error");
Issue expectedIssue = builder.addLocation("SubProperty.code").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'code' content is invalid [null]. Violation: may not be null.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
Property.builder().code("123").valueInteger(2).description("propertyDescription").addSubProperty(SubProperty.builder().description("subDescription").valueInteger(1).build()).build();
}
use of com.b2international.snowowl.fhir.core.model.Issue.Builder in project snow-owl by b2ihealthcare.
the class PropertySerializationTest method emptyCodeTest.
@Test
public void emptyCodeTest() throws Exception {
Builder builder = Issue.builder().code(IssueType.INVALID).severity(IssueSeverity.ERROR).diagnostics("1 validation error");
Issue expectedIssue = builder.addLocation("Property.code.codeValue").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'code.codeValue' content is invalid []. Violation: must match \"[^\\s]+([\\s]?[^\\s]+)*\".").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
Property.builder().code("").build();
}
use of com.b2international.snowowl.fhir.core.model.Issue.Builder in project snow-owl by b2ihealthcare.
the class PropertySerializationTest method missingCodeTest.
@Test
public void missingCodeTest() throws Exception {
Builder builder = Issue.builder().code(IssueType.INVALID).severity(IssueSeverity.ERROR).diagnostics("1 validation error");
Issue expectedIssue = builder.addLocation("Property.code").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'code' content is invalid [null]. Violation: may not be null.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
Property.builder().build();
}
use of com.b2international.snowowl.fhir.core.model.Issue.Builder in project snow-owl by b2ihealthcare.
the class ValidateCodeSystemCodeRequestTest method differentSystemsTest.
@Test
public void differentSystemsTest() {
Builder builder = Issue.builder().code(IssueType.INVALID).severity(IssueSeverity.ERROR).diagnostics("1 validation error");
Issue expectedIssue = builder.addLocation("ValidateCodeRequest.systemsDifferent").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'systemsDifferent' content is invalid [false]." + " Violation: System URL and Coding.system are different.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
ValidateCodeRequest.builder().url("systemURI").coding(Coding.builder().code("A").system("systemURI2").build()).build();
}
use of com.b2international.snowowl.fhir.core.model.Issue.Builder in project snow-owl by b2ihealthcare.
the class ValidateCodeSystemCodeRequestTest method differentSystemsInCodeableTest.
@Test
public void differentSystemsInCodeableTest() {
Builder builder = Issue.builder().code(IssueType.INVALID).severity(IssueSeverity.ERROR).diagnostics("1 validation error");
Issue expectedIssue = builder.addLocation("ValidateCodeRequest.invalidCodeableSystem").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'invalidCodeableSystem' content is invalid [false]." + " Violation: System URL and a Coding.system in Codeable are different.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
ValidateCodeRequest.builder().url("systemURI").codeableConcept(CodeableConcept.builder().addCoding(Coding.builder().code("A").system("systemURI2").build()).build()).build();
}