use of com.synopsys.integration.alert.database.user.AuthenticationTypeEntity in project hub-alert by blackducksoftware.
the class DefaultAuthenticationTypeAccessorTest method getAuthenticationTypeDetailsTest.
@Test
public void getAuthenticationTypeDetailsTest() {
AuthenticationTypeRepository authenticationTypeRepository = Mockito.mock(AuthenticationTypeRepository.class);
DefaultAuthenticationTypeAccessor authenticationTypeAccessor = new DefaultAuthenticationTypeAccessor(authenticationTypeRepository);
AuthenticationTypeEntity authenticationTypeEntity = new AuthenticationTypeEntity("name-test");
Mockito.when(authenticationTypeRepository.findById(Mockito.any())).thenReturn(Optional.of(authenticationTypeEntity));
Optional<AuthenticationTypeDetails> testAuthenticationTypeDetails = authenticationTypeAccessor.getAuthenticationTypeDetails(AuthenticationType.DATABASE);
assertTrue(testAuthenticationTypeDetails.isPresent());
AuthenticationTypeDetails authenticationTypeDetails = testAuthenticationTypeDetails.get();
assertEquals(authenticationTypeEntity.getName(), authenticationTypeDetails.getName());
assertEquals(authenticationTypeEntity.getId(), authenticationTypeDetails.getId());
}
Aggregations