22
33import static io .scalecube .security .environment .VaultEnvironment .getRootCause ;
44import static java .util .concurrent .CompletableFuture .completedFuture ;
5+ import static org .apache .commons .lang3 .RandomStringUtils .secure ;
56import static org .hamcrest .MatcherAssert .assertThat ;
67import static org .hamcrest .core .StringStartsWith .startsWith ;
78import static org .junit .jupiter .api .Assertions .assertNotNull ;
89import static org .junit .jupiter .api .Assertions .assertTrue ;
910import static org .junit .jupiter .api .Assertions .fail ;
10- import static org .testcontainers .shaded .org .apache .commons .lang3 .RandomStringUtils .randomAlphabetic ;
1111
1212import io .scalecube .security .environment .IntegrationEnvironmentFixture ;
1313import io .scalecube .security .environment .VaultEnvironment ;
@@ -32,8 +32,8 @@ void testGetServiceTokenUsingWrongCredentials(VaultEnvironment vaultEnvironment)
3232 final var serviceTokenSupplier =
3333 VaultServiceTokenSupplier .builder ()
3434 .vaultAddress (vaultEnvironment .vaultAddr ())
35- .vaultTokenSupplier (() -> completedFuture (randomAlphabetic (16 )))
36- .serviceRole (randomAlphabetic (16 ))
35+ .vaultTokenSupplier (() -> completedFuture (secure (). nextAlphabetic (16 )))
36+ .serviceRole (secure (). nextAlphabetic (16 ))
3737 .serviceTokenNameBuilder ((role , attributes ) -> role )
3838 .build ();
3939
@@ -141,7 +141,8 @@ void testGetServiceTokenSuccessfully(VaultEnvironment vaultEnvironment) throws E
141141 // Verify serviceToken
142142
143143 final var jwtToken =
144- new Auth0JwtTokenResolver (JwksKeyProvider .builder ().jwksUri (vaultEnvironment .jwksUri ()).build ())
144+ new Auth0JwtTokenResolver (
145+ JwksKeyProvider .builder ().jwksUri (vaultEnvironment .jwksUri ()).build ())
145146 .resolveToken (serviceToken )
146147 .get (3 , TimeUnit .SECONDS );
147148
0 commit comments