use of com.b2international.snowowl.fhir.core.model.Issue 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 in project snow-owl by b2ihealthcare.
the class TranslateRequestDeserializationTest method missingSystemTest.
@Test
public void missingSystemTest() {
Issue expectedIssue = Issue.builder().code(IssueType.INVALID).severity(IssueSeverity.ERROR).diagnostics("1 validation error").addLocation("TranslateRequest.codeAndSystemValid").detailsWithDisplay(OperationOutcomeCode.MSG_PARAM_INVALID, "Parameter 'codeAndSystemValid' content is invalid [false]." + " Violation: Both code and system needs to be provided.").build();
exception.expect(ValidationException.class);
exception.expectMessage("1 validation error");
exception.expect(FhirExceptionIssueMatcher.issue(expectedIssue));
TranslateRequest.builder().code("fatal").target("target").build();
}
use of com.b2international.snowowl.fhir.core.model.Issue in project snow-owl by b2ihealthcare.
the class TranslateRequestDeserializationTest method invalidSnomedVersionTest.
// If the system is SNOMED, no version information is accepted as it is part of the URI
// @see SnomedUri
@Test
public void invalidSnomedVersionTest() {
Issue expectedIssue = Issue.builder().code(IssueType.INVALID).severity(IssueSeverity.ERROR).diagnostics("1 validation error").addLocation("TranslateRequest.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));
TranslateRequest.builder().code("1234").system(SnomedUri.SNOMED_BASE_URI_STRING + "/20180131").version("OTHER_VERSION").targetSystem(SnomedUri.SNOMED_BASE_URI).build();
}
use of com.b2international.snowowl.fhir.core.model.Issue in project snow-owl by b2ihealthcare.
the class TranslateRequestDeserializationTest method missingSourceTest.
@Test
public void missingSourceTest() {
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));
TranslateRequest.builder().target("target").build();
}
use of com.b2international.snowowl.fhir.core.model.Issue in project snow-owl by b2ihealthcare.
the class TranslateRequestDeserializationTest method invalidSnomedCodingTest.
// If the system is SNOMED, no version information is accepted as it is part of the URI
// @see SnomedUri
@Test
public void invalidSnomedCodingTest() {
Issue expectedIssue = Issue.builder().code(IssueType.INVALID).severity(IssueSeverity.ERROR).diagnostics("1 validation error").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));
TranslateRequest.builder().coding(Coding.builder().system(SnomedUri.SNOMED_BASE_URI_STRING).version("OTHER_VERSION").code("fatal").build()).version("OTHER_VERSION").targetSystem(SnomedUri.SNOMED_BASE_URI).build();
}
Aggregations