use of com.azure.identity.DefaultAzureCredential in project vividus by vividus-framework.
the class CredentialFactoryTests method shouldCreateTokenCredential.
@Test
void shouldCreateTokenCredential() {
DefaultAzureCredential defaultAzureCredential = mock(DefaultAzureCredential.class);
try (MockedConstruction<DefaultAzureCredentialBuilder> credentialsBuilder = mockConstruction(DefaultAzureCredentialBuilder.class, (mock, context) -> when(mock.build()).thenReturn(defaultAzureCredential))) {
assertEquals(defaultAzureCredential, CredentialFactory.createTokenCredential());
assertThat(credentialsBuilder.constructed(), hasSize(1));
}
}
Aggregations