Skip to content

Refactor AzureStorageService to inject BlobContainerClient instead of BlobClient#1263

Merged
MartinWheelerMT merged 1 commit into
mainfrom
refactor-storage-services
May 8, 2026
Merged

Refactor AzureStorageService to inject BlobContainerClient instead of BlobClient#1263
MartinWheelerMT merged 1 commit into
mainfrom
refactor-storage-services

Conversation

@MartinWheelerMT
Copy link
Copy Markdown
Collaborator

@MartinWheelerMT MartinWheelerMT commented May 7, 2026

What

  • Move SpotBug suppression warning to the exclude file, for consistency 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.

Why

The adaptor only ever accesses a single blob container with the name as provided in the configuration. At present the adaptor injects a BlobClient and creates a new BlobContainerClient each time an operation is performed against that container. That is inefficient and wasteful of resources.

This fix corrects that by injecting the BlobContainerClient instead.

This also moves the SpotBugs suppression warnings to the SpotBugs Exclusion File to ensure consistency and remove code bloat.

Type of change

Please delete options that are not relevant.

  • Internal change (non-breaking change with no effect on the functionality affecting end users)

Checklist:

  • I have performed a self-review of my code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

…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.
@MartinWheelerMT MartinWheelerMT requested a review from a team as a code owner May 7, 2026 16:20
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Looks good. All 4 mutations in this change were killed.

class surviving killed
💯uk.nhs.adaptors.pss.translator.storage.AzureStorageService 0 3
💯uk.nhs.adaptors.pss.translator.storage.StorageServiceConfig 0 1

See https://pitest.org

@MartinWheelerMT MartinWheelerMT enabled auto-merge (squash) May 7, 2026 16:28
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Images built and published to ECR using a Build Id of PR-1033-7656cfb

@MartinWheelerMT MartinWheelerMT merged commit 4a90dc8 into main May 8, 2026
19 checks passed
@MartinWheelerMT MartinWheelerMT deleted the refactor-storage-services branch May 8, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants