DataBridgeWebClient { protected S3KeyPrefixInformation getS3KeyPrefix(DataBridgeBaseManifestDto manifest, Integer businessObjectDataVersion, Boolean createNewVersion) throws IOException, JAXBException, URISyntaxException, NoSuchAlgorithmException, KeyStoreException, KeyManagementException { LOGGER.info("Retrieving S3 key prefix from the registration server..."); StringBuilder uriPathBuilder = new StringBuilder(151); uriPathBuilder.append(HERD_APP_REST_URI_PREFIX + "/businessObjectData"); if (StringUtils.isNotBlank(manifest.getNamespace())) { uriPathBuilder.append("/namespaces/").append(manifest.getNamespace()); } uriPathBuilder.append("/businessObjectDefinitionNames/").append(manifest.getBusinessObjectDefinitionName()); uriPathBuilder.append("/businessObjectFormatUsages/").append(manifest.getBusinessObjectFormatUsage()); uriPathBuilder.append("/businessObjectFormatFileTypes/").append(manifest.getBusinessObjectFormatFileType()); uriPathBuilder.append("/businessObjectFormatVersions/").append(manifest.getBusinessObjectFormatVersion()); uriPathBuilder.append("/s3KeyPrefix"); String uriPath = uriPathBuilder.toString(); URIBuilder uriBuilder = new URIBuilder().setScheme(getUriScheme()).setHost(regServerAccessParamsDto.getRegServerHost()).setPort(regServerAccessParamsDto.getRegServerPort()) .setPath(uriPath).setParameter("partitionKey", manifest.getPartitionKey()).setParameter("partitionValue", manifest.getPartitionValue()) .setParameter("createNewVersion", createNewVersion.toString()); if (!CollectionUtils.isEmpty(manifest.getSubPartitionValues())) { uriBuilder.setParameter("subPartitionValues", herdStringHelper.join(manifest.getSubPartitionValues(), "|", "\\")); } if (businessObjectDataVersion != null) { uriBuilder.setParameter("businessObjectDataVersion", businessObjectDataVersion.toString()); } if (StringUtils.isNotBlank(manifest.getStorageName())) { uriBuilder.setParameter("storageName", manifest.getStorageName()); } S3KeyPrefixInformation s3KeyPrefixInformation; try (CloseableHttpClient client = httpClientHelper .createHttpClient(regServerAccessParamsDto.isTrustSelfSignedCertificate(), regServerAccessParamsDto.isDisableHostnameVerification())) { HttpGet request = new HttpGet(uriBuilder.build()); request.addHeader("Accepts", DEFAULT_ACCEPT); if (regServerAccessParamsDto.isUseSsl()) { request.addHeader(getAuthorizationHeader()); } LOGGER.info(String.format(" HTTP GET URI: %s", request.getURI().toString())); s3KeyPrefixInformation = getS3KeyPrefixInformation(httpClientOperations.execute(client, request)); } LOGGER.info("Successfully retrieved S3 key prefix from the registration server."); LOGGER.info(" S3 key prefix: " + s3KeyPrefixInformation.getS3KeyPrefix()); return s3KeyPrefixInformation; }  @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 testGetS3KeyPrefix() throws Exception { testGetS3KeyPrefix("testNamespace", Arrays.asList("testSubPartitionValue1", "testSubPartitionValue2"), 0, "testStorage", false); }