Skip to content

Commit 3704264

Browse files
committed
Change exception type for null credential error
Signed-off-by: Daniel Widdis <widdis@gmail.com>
1 parent 1707bac commit 3704264

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

plugins/repository-azure/src/test/java/org/opensearch/repositories/azure/AzureStorageServiceTests.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
package org.opensearch.repositories.azure;
3434

3535
import com.azure.core.http.policy.HttpPipelinePolicy;
36-
import com.azure.identity.CredentialUnavailableException;
3736
import com.azure.storage.blob.BlobServiceClient;
3837
import com.azure.storage.common.policy.RequestRetryPolicy;
38+
import com.microsoft.aad.msal4j.MsalServiceException;
3939
import org.opensearch.common.settings.MockSecureSettings;
4040
import org.opensearch.common.settings.Settings;
4141
import org.opensearch.common.settings.SettingsException;
@@ -202,10 +202,9 @@ public void testClientUsingManagedIdentity() throws IOException {
202202
final BlobServiceClient client1 = azureStorageService.client("azure1").v1();
203203

204204
// Expect the client to use managed identity for authentication, and it should fail because managed identity environment is
205-
// not
206-
// setup in the test
207-
final CredentialUnavailableException e = expectThrows(CredentialUnavailableException.class, () -> client1.getAccountInfo());
208-
assertThat(e.getMessage(), is("Managed Identity authentication is not available."));
205+
// not setup in the test
206+
final MsalServiceException e = expectThrows(MsalServiceException.class, () -> client1.getAccountInfo());
207+
assertThat(e.getMessage(), is("argument \"content\" is null."));
209208
}
210209
}
211210
}

0 commit comments

Comments
 (0)