File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/test/java/redis/clients/jedis/authentication Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 77import static org .junit .jupiter .api .Assertions .assertEquals ;
88import static org .junit .jupiter .api .Assertions .assertNotNull ;
99import static org .junit .jupiter .api .Assertions .assertThrows ;
10+ import static org .junit .jupiter .api .Assertions .assertTrue ;
1011import static org .junit .jupiter .api .Assertions .fail ;
1112import static org .junit .jupiter .api .Assumptions .assumeTrue ;
1213import static org .mockito .ArgumentMatchers .any ;
@@ -300,7 +301,7 @@ public void connectionAuthWithExpiredTokenTest() {
300301 IdentityProviderConfig idpConfig = mock (IdentityProviderConfig .class );
301302 when (idpConfig .getProvider ()).thenReturn (mockIdentityProvider );
302303
303- TokenAuthConfig tokenAuthConfig = EntraIDTokenAuthConfigBuilder .builder ()
304+ TokenAuthConfig tokenAuthConfig = TokenAuthConfig .builder (). tokenRequestExecTimeoutInMs ( 4000 )
304305 .identityProviderConfig (idpConfig ).expirationRefreshRatio (0.000001F ).build ();
305306 AuthXManager authXManager = new AuthXManager (tokenAuthConfig );
306307 DefaultJedisClientConfig jedisClientConfig = DefaultJedisClientConfig .builder ()
@@ -326,8 +327,9 @@ public void connectionAuthWithExpiredTokenTest() {
326327 jedis .del (key );
327328 }
328329 });
329-
330- assertEquals ("WRONGPASS invalid username-password pair" , aclException .getMessage ());
330+ String expectedError = "WRONGPASS invalid username-password pair" ;
331+ assertTrue (aclException .getMessage ().startsWith (expectedError ),
332+ "Expected '" + aclException .getMessage () + "' to start with '" + expectedError + "'" );
331333 }
332334 }
333335
You can’t perform that action at this time.
0 commit comments