DataBridgeWebClient { @SuppressFBWarnings(value = "VA_FORMAT_STRING_USES_NEWLINE", justification = "We will use the standard carriage return character.") public BusinessObjectData preRegisterBusinessObjectData(UploaderInputManifestDto manifest, String storageName, Boolean createNewVersion) throws IOException, JAXBException, URISyntaxException, NoSuchAlgorithmException, KeyStoreException, KeyManagementException { LOGGER.info("Pre-registering business object data with the registration server..."); BusinessObjectDataCreateRequest request = new BusinessObjectDataCreateRequest(); request.setNamespace(manifest.getNamespace()); request.setBusinessObjectDefinitionName(manifest.getBusinessObjectDefinitionName()); request.setBusinessObjectFormatUsage(manifest.getBusinessObjectFormatUsage()); request.setBusinessObjectFormatFileType(manifest.getBusinessObjectFormatFileType()); request.setBusinessObjectFormatVersion(Integer.parseInt(manifest.getBusinessObjectFormatVersion())); request.setPartitionKey(manifest.getPartitionKey()); request.setPartitionValue(manifest.getPartitionValue()); request.setSubPartitionValues(manifest.getSubPartitionValues()); request.setCreateNewVersion(createNewVersion); request.setStatus(BusinessObjectDataStatusEntity.UPLOADING); List<StorageUnitCreateRequest> storageUnits = new ArrayList<>(); request.setStorageUnits(storageUnits); StorageUnitCreateRequest storageUnit = new StorageUnitCreateRequest(); storageUnits.add(storageUnit); storageUnit.setStorageName(storageName); if (manifest.getAttributes() != null) { List<Attribute> attributes = new ArrayList<>(); request.setAttributes(attributes); for (Map.Entry<String, String> entry : manifest.getAttributes().entrySet()) { Attribute attribute = new Attribute(); attributes.add(attribute); attribute.setName(entry.getKey()); attribute.setValue(entry.getValue()); } } request.setBusinessObjectDataParents(manifest.getBusinessObjectDataParents()); JAXBContext requestContext = JAXBContext.newInstance(BusinessObjectDataCreateRequest.class); Marshaller requestMarshaller = requestContext.createMarshaller(); requestMarshaller.setProperty(Marshaller.JAXB_ENCODING, StandardCharsets.UTF_8.name()); requestMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); StringWriter sw = new StringWriter(); requestMarshaller.marshal(request, sw); BusinessObjectData businessObjectData; try (CloseableHttpClient client = httpClientHelper .createHttpClient(regServerAccessParamsDto.isTrustSelfSignedCertificate(), regServerAccessParamsDto.isDisableHostnameVerification())) { URI uri = new URIBuilder().setScheme(getUriScheme()).setHost(regServerAccessParamsDto.getRegServerHost()) .setPort(regServerAccessParamsDto.getRegServerPort()).setPath(HERD_APP_REST_URI_PREFIX + "/businessObjectData").build(); HttpPost post = new HttpPost(uri); post.addHeader("Content-Type", DEFAULT_CONTENT_TYPE); post.addHeader("Accepts", DEFAULT_ACCEPT); if (regServerAccessParamsDto.isUseSsl()) { post.addHeader(getAuthorizationHeader()); } post.setEntity(new StringEntity(sw.toString())); LOGGER.info(String.format(" HTTP POST URI: %s", post.getURI().toString())); LOGGER.info(String.format(" HTTP POST Entity Content:%n%s", sw.toString())); businessObjectData = getBusinessObjectData(httpClientOperations.execute(client, post), "register business object data with the registration server"); } LOGGER.info(String .format("Successfully pre-registered business object data with the registration server. businessObjectDataId=%s", businessObjectData.getId())); return businessObjectData; }  @SuppressFBWarnings(value = "VA_FORMAT_STRING_USES_NEWLINE", justification = "We will use the standard carriage return character.") BusinessObjectDataStorageFilesCreateResponse addStorageFiles(BusinessObjectDataKey businessObjectDataKey, UploaderInputManifestDto manifest,
        S3FileTransferRequestParamsDto s3FileTransferRequestParamsDto, String storageName); RegServerAccessParamsDto getRegServerAccessParamsDto(); void setRegServerAccessParamsDto(RegServerAccessParamsDto regServerAccessParamsDto); Storage getStorage(String storageName); @SuppressFBWarnings(value = "VA_FORMAT_STRING_USES_NEWLINE", justification = "We will use the standard carriage return character.") BusinessObjectData preRegisterBusinessObjectData(UploaderInputManifestDto manifest, String storageName, Boolean createNewVersion); BusinessObjectDataStatusUpdateResponse updateBusinessObjectDataStatus(BusinessObjectDataKey businessObjectDataKey, String businessObjectDataStatus);  }
@Test public void testPreRegisterBusinessObjectData() throws Exception { HashMap<String, String> attributes = new HashMap<>(); attributes.put("testAttributeName", "testAttributeValue"); testPreRegisterBusinessObjectData(attributes, false); }