Add test, changelog, and implementation (#3981)
This commit is contained in:
parent
68c343902a
commit
9fd0addec6
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
type: fix
|
||||||
|
issue: 3980
|
||||||
|
jira: SMILE-5053
|
||||||
|
title: "A regression was introduced in 6.1.0 which caused bulk export jobs to not default to the correct output format when the `_outputFormat` parameter was omitted.
|
||||||
|
This behaviour has been fixed, and if omitted, will now default to the only legal value `application/fhir+ndjson`."
|
|
@ -175,6 +175,28 @@ public class BulkDataExportProviderTest {
|
||||||
assertTrue(params.getFilters().contains(filter));
|
assertTrue(params.getFilters().contains(filter));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testOmittingOutputFormatDefaultsToNdjson() throws IOException {
|
||||||
|
when(myJobRunner.startNewJob(any()))
|
||||||
|
.thenReturn(createJobStartResponse());
|
||||||
|
|
||||||
|
InstantType now = InstantType.now();
|
||||||
|
|
||||||
|
Parameters input = new Parameters();
|
||||||
|
HttpPost post = new HttpPost("http://localhost:" + myPort + "/" + JpaConstants.OPERATION_EXPORT);
|
||||||
|
post.addHeader(Constants.HEADER_PREFER, Constants.HEADER_PREFER_RESPOND_ASYNC);
|
||||||
|
post.setEntity(new ResourceEntity(myCtx, input));
|
||||||
|
|
||||||
|
try (CloseableHttpResponse response = myClient.execute(post)) {
|
||||||
|
assertEquals(202, response.getStatusLine().getStatusCode());
|
||||||
|
}
|
||||||
|
|
||||||
|
BulkExportParameters params = verifyJobStart();
|
||||||
|
assertEquals(Constants.CT_FHIR_NDJSON, params.getOutputFormat());
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSuccessfulInitiateBulkRequest_Get() throws IOException {
|
public void testSuccessfulInitiateBulkRequest_Get() throws IOException {
|
||||||
when(myJobRunner.startNewJob(any())).thenReturn(createJobStartResponse());
|
when(myJobRunner.startNewJob(any())).thenReturn(createJobStartResponse());
|
||||||
|
|
|
@ -365,7 +365,7 @@ public class BulkDataExportProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
private BulkDataExportOptions buildBulkDataExportOptions(IPrimitiveType<String> theOutputFormat, IPrimitiveType<String> theType, IPrimitiveType<Date> theSince, List<IPrimitiveType<String>> theTypeFilter, BulkDataExportOptions.ExportStyle theExportStyle) {
|
private BulkDataExportOptions buildBulkDataExportOptions(IPrimitiveType<String> theOutputFormat, IPrimitiveType<String> theType, IPrimitiveType<Date> theSince, List<IPrimitiveType<String>> theTypeFilter, BulkDataExportOptions.ExportStyle theExportStyle) {
|
||||||
String outputFormat = theOutputFormat != null ? theOutputFormat.getValueAsString() : null;
|
String outputFormat = theOutputFormat != null ? theOutputFormat.getValueAsString() : Constants.CT_FHIR_NDJSON;
|
||||||
|
|
||||||
Set<String> resourceTypes = null;
|
Set<String> resourceTypes = null;
|
||||||
if (theType != null) {
|
if (theType != null) {
|
||||||
|
|
Loading…
Reference in New Issue