### Question:
BulkDataImportUtil { public static String retrieveInputFormat(Parameters parameters) throws FHIROperationException { if (parameters != null) { for (Parameters.Parameter parameter : parameters.getParameter()) { if (BulkDataConstants.PARAM_INPUT_FORMAT.equals(parameter.getName().getValue()) && parameter.getValue() != null && parameter.getValue().is(com.ibm.fhir.model.type.String.class)) { String val = parameter.getValue().as(com.ibm.fhir.model.type.String.class).getValue(); if (BulkDataConstants.INPUT_FORMATS.contains(val)) { return val; } } } } throw buildExceptionWithIssue("$import requires 'inputFormat' is not found", IssueType.INVALID); } private  BulkDataImportUtil(); static FHIROperationException buildExceptionWithIssue(String msg, IssueType issueType); static FHIROperationException buildExceptionWithIssue(String msg, Throwable cause, IssueType issueType); static String retrieveInputFormat(Parameters parameters); static String retrieveInputSource(Parameters parameters); static List<Input> retrieveInputs(Parameters parameters); static void checkAllowedTotalSizeForTenantOrSystem(Integer inputSize); static void verifyUrlAllowed(String url); static StorageDetail retrieveStorageDetails(Parameters parameters);  }### Answer:
@Test public void testBulkImportUtilFormat() throws IOException, FHIRException { FHIRRequestContext.set(new FHIRRequestContext("default")); assertNotNull(BulkDataImportUtil.retrieveInputFormat(loadTestFile("/testdata/import/import-demo.json"))); assertEquals(BulkDataImportUtil.retrieveInputFormat(loadTestFile("/testdata/import/import-demo.json")), "application/fhir+ndjson"); }
@Test(expectedExceptions = { FHIROperationException.class }) public void testBulkImportUtilFormatNull() throws IOException, FHIRException { FHIRRequestContext.set(new FHIRRequestContext("default")); BulkDataImportUtil.retrieveInputFormat(null); }
@Test(expectedExceptions = { FHIROperationException.class }) public void testBulkImportUtilFormatEmptyParameters() throws IOException, FHIRException { FHIRRequestContext.set(new FHIRRequestContext("default")); BulkDataImportUtil.retrieveInputFormat(loadTestFile("/testdata/import/import-demo-empty.json")); }
@Test(expectedExceptions = { FHIROperationException.class }) public void testBulkImportUtilFormatBadFormat() throws IOException, FHIRException { FHIRRequestContext.set(new FHIRRequestContext("default")); BulkDataImportUtil.retrieveInputFormat(loadTestFile("/testdata/import/import-demo-bad-format.json")); }
@Test(expectedExceptions = { FHIROperationException.class }) public void testBulkImportUtilFormatBadFormatNull() throws IOException, FHIRException { FHIRRequestContext.set(new FHIRRequestContext("default")); BulkDataImportUtil.retrieveInputFormat(loadTestFile("/testdata/import/import-demo-bad-format2.json")); }
@Test(expectedExceptions = { FHIROperationException.class }) public void testBulkImportUtilFormatBadFormatWrongType() throws IOException, FHIRException { FHIRRequestContext.set(new FHIRRequestContext("default")); BulkDataImportUtil.retrieveInputFormat(loadTestFile("/testdata/import/import-demo-bad-format3.json")); }