tpalfy commented on a change in pull request #3742: NIFI-6550: Create
controller service for Azure Storage Credentials
URL: https://github.com/apache/nifi/pull/3742#discussion_r325178117
##########
File path:
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/test/java/org/apache/nifi/processors/azure/storage/AbstractAzureStorageIT.java
##########
@@ -64,42 +53,48 @@
} catch (FileNotFoundException e) {
fail("Could not open credentials file " + CREDENTIALS_FILE + ": "
+ e.getLocalizedMessage());
}
-
}
- public static String getAccountName() {
+ protected static String getAccountName() {
return CONFIG.getProperty("accountName");
}
- public static String getAccountKey() {
+ protected static String getAccountKey() {
return CONFIG.getProperty("accountKey");
}
- public static CloudBlobContainer getContainer(String containerName) throws
InvalidKeyException, URISyntaxException, StorageException {
- CloudBlobClient blobClient =
getStorageAccount().createCloudBlobClient();
- return blobClient.getContainerReference(containerName);
- }
+ protected TestRunner runner;
+
+ @Before
+ public void setUpAzureStorageIT() {
+ runner = TestRunners.newTestRunner(getProcessorClass());
- public static CloudQueue getQueue(String queueName) throws
URISyntaxException, InvalidKeyException, StorageException {
- CloudQueueClient cloudQueueClient =
getStorageAccount().createCloudQueueClient();
- cloudQueue = cloudQueueClient.getQueueReference(queueName);
- return cloudQueue;
+ runner.setProperty(AzureStorageUtils.ACCOUNT_NAME, getAccountName());
+ runner.setProperty(AzureStorageUtils.ACCOUNT_KEY, getAccountKey());
}
- private static CloudStorageAccount getStorageAccount() throws
URISyntaxException, InvalidKeyException {
+ protected abstract Class<? extends Processor> getProcessorClass();
+
+ protected CloudStorageAccount getStorageAccount() throws Exception {
String storageConnectionString =
String.format(FORMAT_CONNECTION_STRING, getAccountName(), getAccountKey());
Review comment:
As this is an integration test, shouldn't we create the
`CloudBlob/QueueClient` the same way as it is done in the refactored/changed
production code?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services