Skip to content

Commit 69656d5

Browse files
RyAuldCopilot
andcommitted
Remove unused _keyVault field from OBO test classes
Addresses Copilot review feedback: _keyVault (MsalTeam instance) is no longer referenced after switching to _keyVaultMsidLab for LabAuth cert. Removing to avoid CS0169 warning with TreatWarningsAsErrors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent fa2a58a commit 69656d5

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

tests/Microsoft.Identity.Test.Integration.netcore/HeadlessTests/LongRunningOnBehalfOfTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public class LongRunningOnBehalfOfTests
2525

2626
private X509Certificate2 _labAuthCert;
2727

28-
private readonly KeyVaultSecretsProvider _keyVault = new KeyVaultSecretsProvider(KeyVaultInstance.MsalTeam);
2928
private readonly KeyVaultSecretsProvider _keyVaultMsidLab = new KeyVaultSecretsProvider(KeyVaultInstance.MSIDLab);
3029

3130
#region Test Hooks

tests/Microsoft.Identity.Test.Integration.netcore/HeadlessTests/OnBehalfOfTests.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public class OnBehalfOfTests
2929
private static InMemoryTokenCache s_inMemoryTokenCache = new InMemoryTokenCache();
3030
private X509Certificate2 _labAuthCert;
3131

32-
private readonly KeyVaultSecretsProvider _keyVault = new KeyVaultSecretsProvider(KeyVaultInstance.MsalTeam);
3332
private readonly KeyVaultSecretsProvider _keyVaultMsidLab = new KeyVaultSecretsProvider(KeyVaultInstance.MSIDLab);
3433

3534
#region Test Hooks
@@ -521,24 +520,17 @@ void AssertExtraHttpHeadersAreSent(HttpSnifferClientFactory factory)
521520

522521
private async Task<ConfidentialClientApplication> BuildCcaAsync(string tenantId, bool withRegion = false)
523522
{
524-
var appConfig = await LabResponseHelper.GetAppConfigAsync(KeyVaultSecrets.AppS2S).ConfigureAwait(false);
525523
var appApiConfig = await LabResponseHelper.GetAppConfigAsync(KeyVaultSecrets.AppOBOService).ConfigureAwait(false);
526-
string secret = LabResponseHelper.FetchSecretString(appConfig.SecretName, LabResponseHelper.KeyVaultSecretsProviderMsal);
527524

528525
var builder = ConfidentialClientApplicationBuilder
529-
.Create(withRegion ? appApiConfig.AppId : appConfig.AppId)
526+
.Create(appApiConfig.AppId)
530527
.WithAuthority(new Uri($"https://login.microsoftonline.com/{tenantId}"), true)
528+
.WithCertificate(_labAuthCert, true)
531529
.WithLegacyCacheCompatibility(false);
532530

533531
if (withRegion)
534532
{
535-
builder
536-
.WithCertificate(_labAuthCert, true)
537-
.WithAzureRegion(TestConstants.Region);
538-
}
539-
else
540-
{
541-
builder.WithClientSecret(secret);
533+
builder.WithAzureRegion(TestConstants.Region);
542534
}
543535

544536
return builder.BuildConcrete();

0 commit comments

Comments
 (0)