use of com.b2international.snowowl.fhir.core.model.BatchResponse in project snow-owl by b2ihealthcare.
the class BundleTest method deserializeOperationOutcomeBundle.
@Test
public void deserializeOperationOutcomeBundle() throws JsonProcessingException {
OperationOutcome operationOutcome = OperationOutcome.builder().addIssue(Issue.builder().code(IssueType.CODE_INVALID).diagnostics("Invalid code").severity(IssueSeverity.ERROR).build()).build();
OperationOutcomeEntry operationOutcomeEntry = OperationOutcomeEntry.builder().operationOutcome(operationOutcome).response(new BatchResponse("404")).build();
Bundle bundle = Bundle.builder().language("en").type(BundleType.BATCH_RESPONSE).addLink("self", "http://localhost:8080/snowowl/CodeSystem").addEntry(operationOutcomeEntry).build();
String json = objectMapper.writeValueAsString(bundle);
Bundle readBundle = objectMapper.readValue(json, Bundle.class);
assertEquals("batch-response", readBundle.getType().getCodeValue());
}
Aggregations