use of uk.gov.ida.hub.config.domain.IdentityProviderConfigEntityData in project verify-hub by alphagov.
the class EnabledIdpPredicateTest method shouldBeFalseForDisabled.
@Test
public void shouldBeFalseForDisabled() throws Exception {
Predicate<IdentityProviderConfigEntityData> enabledPredicate = new EnabledIdpPredicate();
IdentityProviderConfigEntityData disabledIdp = anIdentityProviderConfigData().withEnabled(false).build();
assertThat(enabledPredicate.apply(disabledIdp)).isFalse();
}
use of uk.gov.ida.hub.config.domain.IdentityProviderConfigEntityData in project verify-hub by alphagov.
the class OnboardingForTransactionEntityPredicateTest method shouldBeTrueForNonOnboarding.
@Test
public void shouldBeTrueForNonOnboarding() {
String transactionEntity = "transactionEntity";
Predicate<IdentityProviderConfigEntityData> onboardingPredicate = new OnboardingForTransactionEntityPredicate(transactionEntity);
IdentityProviderConfigEntityData nonOnboardingIdp = anIdentityProviderConfigData().build();
assertThat(onboardingPredicate.apply(nonOnboardingIdp)).isTrue();
}
use of uk.gov.ida.hub.config.domain.IdentityProviderConfigEntityData in project verify-hub by alphagov.
the class OnboardingForTransactionEntityPredicateTest method shouldBeFalseForOnboardingDifferentTransactionEntity.
@Test
public void shouldBeFalseForOnboardingDifferentTransactionEntity() {
String transactionEntity = "transactionEntity";
List<String> differentTransactionEntity = ImmutableList.of("differentTransactionEntity");
Predicate<IdentityProviderConfigEntityData> onboardingPredicate = new OnboardingForTransactionEntityPredicate(transactionEntity);
IdentityProviderConfigEntityData onboardingDifferentTransactionEntityIdp = anIdentityProviderConfigData().withOnboarding(differentTransactionEntity).build();
assertThat(onboardingPredicate.apply(onboardingDifferentTransactionEntityIdp)).isFalse();
}
use of uk.gov.ida.hub.config.domain.IdentityProviderConfigEntityData in project verify-hub by alphagov.
the class IdentityProviderConfigOnboardingTransactionValidatorTest method validate_shouldNotThrowExceptionWhenOnboardingTransactionEntityIdExists.
@Test
public void validate_shouldNotThrowExceptionWhenOnboardingTransactionEntityIdExists() throws Exception {
String transactionEntityID = "transactionEntityID";
IdentityProviderConfigEntityData identityProviderConfigEntityData = anIdentityProviderConfigData().withOnboarding(ImmutableList.of(transactionEntityID)).build();
TransactionConfigEntityData transactionConfigEntity = aTransactionConfigData().build();
when(transactionConfigEntityDataConfigEntityDataRepository.getData(transactionEntityID)).thenReturn(Optional.ofNullable(transactionConfigEntity));
identityProviderConfigOnboardingTransactionValidator.validate(identityProviderConfigEntityData);
}
use of uk.gov.ida.hub.config.domain.IdentityProviderConfigEntityData in project verify-hub by alphagov.
the class IdentityProviderConfigOnboardingTransactionValidatorTest method validate_shouldThrowExceptionWhenOnboardingTransactionDoesNotExist.
@Test
public void validate_shouldThrowExceptionWhenOnboardingTransactionDoesNotExist() throws Exception {
String transactionEntityID = "transactionEntityID";
String idpEntityId = "idpEntityId";
IdentityProviderConfigEntityData identityProviderConfigEntityData = anIdentityProviderConfigData().withEntityId(idpEntityId).withOnboarding(ImmutableList.of(transactionEntityID)).build();
when(transactionConfigEntityDataConfigEntityDataRepository.getData(transactionEntityID)).thenReturn(Optional.empty());
try {
identityProviderConfigOnboardingTransactionValidator.validate(identityProviderConfigEntityData);
fail("fail");
} catch (ConfigValidationException e) {
final ConfigValidationException expectedException = createAbsentOnboardingTransactionConfigException(transactionEntityID, idpEntityId);
assertThat(expectedException.getMessage()).isEqualTo(e.getMessage());
}
}
Aggregations