4084 error segment of bulk export job poll status is missing (#4085)
* changelog * Change serialization rules * Always populate error field even if no errors
This commit is contained in:
parent
96b92153f6
commit
f06f9dc90a
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
type: fix
|
||||||
|
issue: 4084
|
||||||
|
jira: SMILE-5220
|
||||||
|
title: "Previously, the `error` segment of the `$poll-export-status` operation was missing. This has now been added."
|
|
@ -89,14 +89,17 @@ public class BulkExportUseCaseTest extends BaseResourceProviderR4Test {
|
||||||
String expectedOriginalUrl = myClient.getServerBase() + "/$export?_type=Patient";
|
String expectedOriginalUrl = myClient.getServerBase() + "/$export?_type=Patient";
|
||||||
try (CloseableHttpResponse status = ourHttpClient.execute(statusGet)) {
|
try (CloseableHttpResponse status = ourHttpClient.execute(statusGet)) {
|
||||||
String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8);
|
String responseContent = IOUtils.toString(status.getEntity().getContent(), StandardCharsets.UTF_8);
|
||||||
|
|
||||||
ourLog.info(responseContent);
|
ourLog.info(responseContent);
|
||||||
|
|
||||||
BulkExportResponseJson result = JsonUtil.deserialize(responseContent, BulkExportResponseJson.class);
|
BulkExportResponseJson result = JsonUtil.deserialize(responseContent, BulkExportResponseJson.class);
|
||||||
assertThat(result.getRequest(), is(equalTo(expectedOriginalUrl)));
|
assertThat(result.getRequest(), is(equalTo(expectedOriginalUrl)));
|
||||||
assertThat(result.getRequiresAccessToken(), is(equalTo(true)));
|
assertThat(result.getRequiresAccessToken(), is(equalTo(true)));
|
||||||
assertThat(result.getTransactionTime(), is(notNullValue()));
|
assertThat(result.getTransactionTime(), is(notNullValue()));
|
||||||
assertThat(result.getError(), is(empty()));
|
|
||||||
assertThat(result.getOutput(), is(not(empty())));
|
assertThat(result.getOutput(), is(not(empty())));
|
||||||
|
|
||||||
|
//We assert specifically on content as the deserialized version will "helpfully" fill in missing fields.
|
||||||
|
assertThat(responseContent, containsString("\"error\" : [ ]"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,8 +49,13 @@ public class BulkExportResponseJson {
|
||||||
private Boolean myRequiresAccessToken;
|
private Boolean myRequiresAccessToken;
|
||||||
@JsonProperty("output")
|
@JsonProperty("output")
|
||||||
private List<Output> myOutput;
|
private List<Output> myOutput;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Note that we override the include here as ONC regulations require that we actually serialize the empty error array.
|
||||||
|
*/
|
||||||
|
@JsonInclude
|
||||||
@JsonProperty("error")
|
@JsonProperty("error")
|
||||||
private List<Output> myError;
|
private List<Output> myError = new ArrayList<>();
|
||||||
|
|
||||||
@JsonProperty("message")
|
@JsonProperty("message")
|
||||||
private String myMsg;
|
private String myMsg;
|
||||||
|
|
Loading…
Reference in New Issue