Refactor AzureStorageService to inject BlobContainerClient instead of BlobClient#1263
Merged
Conversation
…cy when suppressing the warning for thread safe immutable cloud dependencies. * Refactor `AzureStorageService` and dependent tests to now inject the container client service, reducing the need to create a new one each time a work function is called against the service.
|
Looks good. All 4 mutations in this change were killed.
|
|
Images built and published to ECR using a Build Id of PR-1033-7656cfb |
Jonopono123
approved these changes
May 8, 2026
chiaramapellimt
pushed a commit
that referenced
this pull request
May 13, 2026
* NIAD-3453: Refactor `StorageService` to correctly use DI/IOC * Delete StorageServiceFactory.java and StorageServiceFactoryConfig.java as unnecessary and confusing steps in the DI process. * NIAD-3453: Refactor `StorageService` to correctly use DI/IOC * Introduce StorageServiceConfig to conditionally create the required service. * Refactor AzureStorageService to now correctly inject the StorageServiceClient from the IOC container. * Add Integration Test dfor AzureStorageService. * Add `testcontainers` to `build.gradle` to enable use of azurite. * Remove now unused methods in `AzureStorageService`. * Add unit tests for `AzureStorageService` * Add annotations to `StorageServiceConfig` to tell the compiler that a null value will not be returned. * Add unit tests for `StorageServiceConfig` * Update container name to remove underscore * Address issues with test names. * Add default coding for for the byte conversion in the tests. Refactor AzureStorageService to inject BlobContainerClient instead of BlobClient (#1263) * Refactor `AzureStorageService` and dependent tests to now inject the container client service, reducing the need to create a new one each time a work function is called against the service. * Move SpotBug suppression warning to the exclude file, for consistency when suppressing the warning for thread safe immutable cloud dependencies. (#1263)
chiaramapellimt
pushed a commit
that referenced
this pull request
May 13, 2026
* NIAD-3453: Refactor `StorageService` to correctly use DI/IOC * Delete StorageServiceFactory.java and StorageServiceFactoryConfig.java as unnecessary and confusing steps in the DI process. * NIAD-3453: Refactor `StorageService` to correctly use DI/IOC * Introduce StorageServiceConfig to conditionally create the required service. * Refactor AzureStorageService to now correctly inject the StorageServiceClient from the IOC container. * Add Integration Test dfor AzureStorageService. * Add `testcontainers` to `build.gradle` to enable use of azurite. * Remove now unused methods in `AzureStorageService`. * Add unit tests for `AzureStorageService` * Add annotations to `StorageServiceConfig` to tell the compiler that a null value will not be returned. * Add unit tests for `StorageServiceConfig` * Update container name to remove underscore * Address issues with test names. * Add default coding for for the byte conversion in the tests. Refactor AzureStorageService to inject BlobContainerClient instead of BlobClient (#1263) * Refactor `AzureStorageService` and dependent tests to now inject the container client service, reducing the need to create a new one each time a work function is called against the service. * Move SpotBug suppression warning to the exclude file, for consistency when suppressing the warning for thread safe immutable cloud dependencies. (#1263)
chiaramapellimt
pushed a commit
that referenced
this pull request
May 13, 2026
* NIAD-3453: Refactor `StorageService` to correctly use DI/IOC * Delete StorageServiceFactory.java and StorageServiceFactoryConfig.java as unnecessary and confusing steps in the DI process. * NIAD-3453: Refactor `StorageService` to correctly use DI/IOC * Introduce StorageServiceConfig to conditionally create the required service. * Refactor AzureStorageService to now correctly inject the StorageServiceClient from the IOC container. * Add Integration Test dfor AzureStorageService. * Add `testcontainers` to `build.gradle` to enable use of azurite. * Remove now unused methods in `AzureStorageService`. * Add unit tests for `AzureStorageService` * Add annotations to `StorageServiceConfig` to tell the compiler that a null value will not be returned. * Add unit tests for `StorageServiceConfig` * Update container name to remove underscore * Address issues with test names. * Add default coding for for the byte conversion in the tests. Refactor AzureStorageService to inject BlobContainerClient instead of BlobClient (#1263) * Refactor `AzureStorageService` and dependent tests to now inject the container client service, reducing the need to create a new one each time a work function is called against the service. * Move SpotBug suppression warning to the exclude file, for consistency when suppressing the warning for thread safe immutable cloud dependencies. (#1263)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
AzureStorageServiceand dependent tests to now inject the container client service, reducing the need to create a new one each time a work function is called against the service.Why
The adaptor only ever accesses a single blob container with the name as provided in the configuration. At present the adaptor injects a
BlobClientand creates a newBlobContainerClienteach time an operation is performed against that container. That is inefficient and wasteful of resources.This fix corrects that by injecting the
BlobContainerClientinstead.This also moves the
SpotBugssuppression warnings to theSpotBugs Exclusion Fileto ensure consistency and remove code bloat.Type of change
Please delete options that are not relevant.
Checklist: