test_class.file: herd-code/herd-tools/herd-downloader/src/test/java/org/finra/herd/tools/downloader/DownloaderWebClientTest.java
test_class.identifier: DownloaderWebClientTest
test_class.superclass: extends AbstractDownloaderTest
test_case.body: @Test
      public void testGetBusinessObjectDataDownloadCredentialAssertNoAuthorizationHeaderWhenNoSsl() throws Exception
      {
          HttpClientOperations mockHttpClientOperations = mock(HttpClientOperations.class);
          HttpClientOperations originalHttpClientOperations = (HttpClientOperations) ReflectionTestUtils.getField(downloaderWebClient, "httpClientOperations");
          ReflectionTestUtils.setField(downloaderWebClient, "httpClientOperations", mockHttpClientOperations);
  
          try
          {
              CloseableHttpResponse closeableHttpResponse = mock(CloseableHttpResponse.class);
              when(mockHttpClientOperations.execute(any(), any())).thenReturn(closeableHttpResponse);
  
              when(closeableHttpResponse.getStatusLine()).thenReturn(new BasicStatusLine(HttpVersion.HTTP_1_1, 200, "SUCCESS"));
              when(closeableHttpResponse.getEntity()).thenReturn(new StringEntity(xmlHelper.objectToXml(new StorageUnitDownloadCredential())));
  
              DownloaderInputManifestDto downloaderInputManifestDto = new DownloaderInputManifestDto();
              String storageName = "storageName";
              boolean useSsl = false;
  
              downloaderWebClient.getRegServerAccessParamsDto().setUseSsl(useSsl);
              downloaderWebClient.getStorageUnitDownloadCredential(downloaderInputManifestDto, storageName);
  
              verify(mockHttpClientOperations).execute(any(), argThat(httpUriRequest -> httpUriRequest.getFirstHeader("Authorization") == null));
          }
          finally
          {
              ReflectionTestUtils.setField(downloaderWebClient, "httpClientOperations", originalHttpClientOperations);
          }
      }
test_case.class_method_signature: DownloaderWebClientTest.testGetBusinessObjectDataDownloadCredentialAssertNoAuthorizationHeaderWhenNoSsl()
test_case.full_signature: @Test public void testGetBusinessObjectDataDownloadCredentialAssertNoAuthorizationHeaderWhenNoSsl()
test_case.identifier: testGetBusinessObjectDataDownloadCredentialAssertNoAuthorizationHeaderWhenNoSsl
test_case.invocations: mock getField setField mock thenReturn when execute any any thenReturn when getStatusLine thenReturn when getEntity objectToXml setUseSsl getRegServerAccessParamsDto getStorageUnitDownloadCredential execute verify any argThat getFirstHeader setField
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetBusinessObjectDataDownloadCredentialAssertNoAuthorizationHeaderWhenNoSsl()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(DownloaderWebClient.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(DownloaderWebClient.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.file: herd-code/herd-tools/herd-downloader/src/main/java/org/finra/herd/tools/downloader/DownloaderWebClient.java
focal_class.identifier: DownloaderWebClient
focal_class.class_method_signature: DownloaderWebClient.getBusinessObjectData(DownloaderInputManifestDto manifest)
focal_class.full_signature: public BusinessObjectData getBusinessObjectData(DownloaderInputManifestDto manifest)
focal_class.identifier: getBusinessObjectData
focal_class.modifiers: public
focal_class.parameters: (DownloaderInputManifestDto manifest)
focal_class.return: BusinessObjectData
focal_class.signature: BusinessObjectData getBusinessObjectData(DownloaderInputManifestDto manifest)
focal_class.class_method_signature: DownloaderWebClient.getS3KeyPrefix(BusinessObjectData businessObjectData)
focal_class.full_signature: public S3KeyPrefixInformation getS3KeyPrefix(BusinessObjectData businessObjectData)
focal_class.identifier: getS3KeyPrefix
focal_class.modifiers: public
focal_class.parameters: (BusinessObjectData businessObjectData)
focal_class.return: S3KeyPrefixInformation
focal_class.signature: S3KeyPrefixInformation getS3KeyPrefix(BusinessObjectData businessObjectData)
focal_class.class_method_signature: DownloaderWebClient.getStorageUnitDownloadCredential(DownloaderInputManifestDto manifest, String storageName)
focal_class.full_signature: public StorageUnitDownloadCredential getStorageUnitDownloadCredential(DownloaderInputManifestDto manifest, String storageName)
focal_class.identifier: getStorageUnitDownloadCredential
focal_class.modifiers: public
focal_class.parameters: (DownloaderInputManifestDto manifest, String storageName)
focal_class.return: StorageUnitDownloadCredential
focal_class.signature: StorageUnitDownloadCredential getStorageUnitDownloadCredential(DownloaderInputManifestDto manifest, String storageName)
focal_class.class_method_signature: DownloaderWebClient.getStorageUnitDownloadCredential(CloseableHttpResponse response)
focal_class.full_signature: private StorageUnitDownloadCredential getStorageUnitDownloadCredential(CloseableHttpResponse response)
focal_class.identifier: getStorageUnitDownloadCredential
focal_class.modifiers: private
focal_class.parameters: (CloseableHttpResponse response)
focal_class.return: StorageUnitDownloadCredential
focal_class.signature: StorageUnitDownloadCredential getStorageUnitDownloadCredential(CloseableHttpResponse response)
focal_class.superclass: extends DataBridgeWebClient
focal_method.body: public StorageUnitDownloadCredential getStorageUnitDownloadCredential(DownloaderInputManifestDto manifest, String storageName)
          throws URISyntaxException, IOException, JAXBException, NoSuchAlgorithmException, KeyStoreException, KeyManagementException
      {
          URIBuilder uriBuilder =
              new URIBuilder().setScheme(getUriScheme()).setHost(regServerAccessParamsDto.getRegServerHost()).setPort(regServerAccessParamsDto.getRegServerPort())
                  .setPath(String.join("/", HERD_APP_REST_URI_PREFIX, "storageUnits", "download", "credential", "namespaces", manifest.getNamespace(),
                      "businessObjectDefinitionNames", manifest.getBusinessObjectDefinitionName(), "businessObjectFormatUsages",
                      manifest.getBusinessObjectFormatUsage(), "businessObjectFormatFileTypes", manifest.getBusinessObjectFormatFileType(),
                      "businessObjectFormatVersions", manifest.getBusinessObjectFormatVersion(), "partitionValues", manifest.getPartitionValue(),
                      "businessObjectDataVersions", manifest.getBusinessObjectDataVersion(), "storageNames", storageName));
          if (manifest.getSubPartitionValues() != null)
          {
              uriBuilder.addParameter("subPartitionValues", herdStringHelper.join(manifest.getSubPartitionValues(), "|", "\\"));
          }
          HttpGet httpGet = new HttpGet(uriBuilder.build());
          httpGet.addHeader("Accept", DEFAULT_ACCEPT);
          if (regServerAccessParamsDto.isUseSsl())
          {
              httpGet.addHeader(getAuthorizationHeader());
          }
          try (CloseableHttpClient httpClient = httpClientHelper
              .createHttpClient(regServerAccessParamsDto.isTrustSelfSignedCertificate(), regServerAccessParamsDto.isDisableHostnameVerification()))
          {
              LOGGER.info("Retrieving download credentials from registration server...");
              return getStorageUnitDownloadCredential(httpClientOperations.execute(httpClient, httpGet));
          }
      }
focal_method.class_method_signature: DownloaderWebClient.getStorageUnitDownloadCredential(DownloaderInputManifestDto manifest, String storageName)
focal_method.full_signature: public StorageUnitDownloadCredential getStorageUnitDownloadCredential(DownloaderInputManifestDto manifest, String storageName)
focal_method.identifier: getStorageUnitDownloadCredential
focal_method.invocations: setPath setPort setHost setScheme getUriScheme getRegServerHost getRegServerPort join getNamespace getBusinessObjectDefinitionName getBusinessObjectFormatUsage getBusinessObjectFormatFileType getBusinessObjectFormatVersion getPartitionValue getBusinessObjectDataVersion getSubPartitionValues addParameter join getSubPartitionValues build addHeader isUseSsl addHeader getAuthorizationHeader createHttpClient isTrustSelfSignedCertificate isDisableHostnameVerification info getStorageUnitDownloadCredential execute
focal_method.modifiers: public
focal_method.parameters: (DownloaderInputManifestDto manifest, String storageName)
focal_method.return: StorageUnitDownloadCredential
focal_method.signature: StorageUnitDownloadCredential getStorageUnitDownloadCredential(DownloaderInputManifestDto manifest, String storageName)