Skip to content
Snippets Groups Projects
Commit 0a95bc39 authored by Deepa Kumari's avatar Deepa Kumari
Browse files

review remarks

parent e212a737
No related branches found
No related tags found
1 merge request!777Increase azure code coverage
Pipeline #272670 failed
......@@ -93,19 +93,14 @@ public class RedisConfigTest {
@Test
public void shouldReturnRedisPasswordFromKeyvault_when_redisHostIsCalled() {
try (MockedStatic<KeyVaultFacade> keyVaultFacadeMockedStatic = mockStatic(KeyVaultFacade.class)) {
// Mock the SecretClient
SecretClient mockedSecretClient = mock(SecretClient.class);
// Set up the static method call with arguments
keyVaultFacadeMockedStatic.when(() -> KeyVaultFacade.getSecretWithValidation(mockedSecretClient, "redis-password"))
.thenReturn("password");
String result = sut.redisPassword(mockedSecretClient);
// Verify the result
assertEquals("password", result);
//check that keyvault facade was called with our secret client for redis-hostname
keyVaultFacadeMockedStatic.verify(()->KeyVaultFacade.getSecretWithValidation(mockedSecretClient, "redis-password"));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment