Skip to content

Commit aa9bc8d

Browse files
Test AppConfigAWSCredentials case
1 parent 54e130b commit aa9bc8d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/MongoDB.Driver.Tests/Communication/Security/AwsAuthenticationTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ public void AwsSdk_should_support_all_required_callbacks()
7575

7676
// Attempt 1
7777
AWSCredentials credentials = null;
78+
if (Type.GetType("Amazon.Runtime.AppConfigAWSCredentials", throwOnError: false) != null)
79+
{
80+
var appConfigAWSCredentialsException = Record.Exception(() => RunTestCase());
81+
// app.config/web.config case based on ConfigurationManager. This is not configured for this test
82+
appConfigAWSCredentialsException.Message.Should().Contain("The app.config/web.config files for the application did not contain credential information");
83+
}
84+
7885
var exception = Record.Exception(() => RunTestCase());
7986
if (Environment.GetEnvironmentVariable("AWS_WEB_IDENTITY_TOKEN_FILE") != null)
8087
{

0 commit comments

Comments
 (0)