Skip to content

Commit

Permalink
idp-when partitions not enabled, do not use default ms partition (#2878)
Browse files Browse the repository at this point in the history
## Description
IDP - when partitions not enabled, do not use default ms partition in
blob path.

## Related issues
Addresses
[[AB#105115](https://microsofthealth.visualstudio.com/f8da5110-49b1-4e9f-9022-2f58b6124ff9/_workitems/edit/105115)].

## Testing
Updated unit test
  • Loading branch information
esmadau authored Jul 7, 2023
1 parent ec05b14 commit c76e67c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ public void GivenExternalStore_WhenGetServiceStorePathWithPartitionsEnabled_Then
}

[Fact]
public void GivenExternalStore_WhenGetServiceStorePathWithPartitionsDisabled_ThenPathReturnedUsesDefaultMsPartition()
public void GivenExternalStore_WhenGetServiceStorePathWithPartitionsDisabled_ThenPathReturnedDoesNotUsePartition()
{
InitializeExternalBlobFileStore(out BlobFileStore _, out ExternalBlobClient client, partitionsEnabled: false);
Assert.Equal(DefaultStorageDirectory + DefaultPartition.Name + "/", client.GetServiceStorePath("foo"));
Assert.Equal(DefaultStorageDirectory, client.GetServiceStorePath("foo"));
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using Microsoft.Health.Dicom.Core.Configs;
using Microsoft.Health.Dicom.Core.Exceptions;
using Microsoft.Health.Dicom.Core.Features.Common;
using Microsoft.Health.Dicom.Core.Features.Partition;

namespace Microsoft.Health.Dicom.Blob.Features.ExternalStore;

Expand Down Expand Up @@ -98,6 +97,6 @@ public string GetServiceStorePath(string partitionName)
{
return _isPartitionEnabled ?
_externalStoreOptions.StorageDirectory + partitionName + "/" :
_externalStoreOptions.StorageDirectory + PartitionEntry.Default.PartitionName + "/";
_externalStoreOptions.StorageDirectory;
}
}

0 comments on commit c76e67c

Please sign in to comment.