@@ -72,35 +72,13 @@ public void WithAuthentication_UsernameIamAuthConfig_ConfiguresCorrectly()
7272 Assert . Throws < ArgumentNullException > ( ( ) => builder . WithAuthentication ( Username , ( IamAuthConfig ) null ! ) ) ;
7373 }
7474
75- [ Fact ]
76- public void WithAuthentication_UsernameClusterServiceRegionRefreshInterval ( )
77- {
78- var builder = new StandaloneClientConfigurationBuilder ( ) ;
79- builder . WithAuthentication ( Username , ClusterName , ServiceType . MemoryDB , Region , RefreshIntervalSeconds ) ;
80-
81- var config = builder . Build ( ) ;
82- var authenticationInfo = config ! . Request . AuthenticationInfo ! . Value ;
83- var iamCredentials = authenticationInfo . IamCredentials ! . Value ;
84-
85- Assert . Equal ( Username , authenticationInfo . Username ) ;
86- Assert . Null ( authenticationInfo . Password ) ;
87- Assert . Equal ( ClusterName , iamCredentials . ClusterName ) ;
88- Assert . Equal ( Region , iamCredentials . Region ) ;
89- Assert . Equal ( FFI . ServiceType . MemoryDB , iamCredentials . ServiceType ) ;
90- Assert . Equal ( RefreshIntervalSeconds , iamCredentials . RefreshIntervalSeconds ) ;
91-
92- // Username, cluster name, and region cannot be null.
93- Assert . Throws < ArgumentNullException > ( ( ) => builder . WithAuthentication ( null ! , ClusterName , ServiceType . ElastiCache , Region , RefreshIntervalSeconds ) ) ;
94- Assert . Throws < ArgumentNullException > ( ( ) => builder . WithAuthentication ( Username , null ! , ServiceType . ElastiCache , Region , RefreshIntervalSeconds ) ) ;
95- Assert . Throws < ArgumentNullException > ( ( ) => builder . WithAuthentication ( Username , ClusterName , ServiceType . ElastiCache , null ! , RefreshIntervalSeconds ) ) ;
96- }
97-
9875 [ Fact ]
9976 public void WithAuthentication_MultipleCalls_LastWins ( )
10077 {
10178 // Password-based authentication last.
10279 var builder = new StandaloneClientConfigurationBuilder ( ) ;
103- builder . WithAuthentication ( Username , ClusterName , ServiceType . MemoryDB , Region ) ;
80+ var iamConfig = new IamAuthConfig ( ClusterName , ServiceType . ElastiCache , Region , RefreshIntervalSeconds ) ;
81+ builder . WithAuthentication ( Username , iamConfig ) ;
10482 builder . WithAuthentication ( Username , Password ) ;
10583
10684 var config = builder . Build ( ) ;
@@ -113,7 +91,7 @@ public void WithAuthentication_MultipleCalls_LastWins()
11391 // IAM authentication last.
11492 builder = new StandaloneClientConfigurationBuilder ( ) ;
11593 builder . WithAuthentication ( Username , Password ) ;
116- builder . WithAuthentication ( Username , ClusterName , ServiceType . MemoryDB , Region , RefreshIntervalSeconds ) ;
94+ builder . WithAuthentication ( Username , iamConfig ) ;
11795
11896 config = builder . Build ( ) ;
11997 authenticationInfo = config ! . Request . AuthenticationInfo ! . Value ;
0 commit comments