### Question:
LevelsOfAssuranceConfigValidator { protected void validateAllTransactionsAreSupportedByIDPs(Set<IdentityProviderConfig> identityProviderConfig, Set<TransactionConfig> transactionConfig) { Map<TransactionConfig, List<IdentityProviderConfig>> unsupportedTransaction = transactionConfig.stream() .collect(Collectors.toMap( identity(), config -> unsupportedIdpsForATransaction(identityProviderConfig, config) )); if (unsupportedTransaction.values().stream().anyMatch(x -> !x.isEmpty())) { throw ConfigValidationException.createIncompatiblePairsOfTransactionsAndIDPs(unsupportedTransaction); } }  void validateLevelsOfAssurance(final Set<IdentityProviderConfig> identityProviderConfig,
                                           final Set<TransactionConfig> transactionConfig);  }### Answer:
@Test(expected = ConfigValidationException.class) public void shouldThrowWhenOneIdpDoesNotSupportATransaction() { Set<IdentityProviderConfig> identityProviderConfig = Set.of(loa1Idp, loa2Idp); Set<TransactionConfig> transactionsConfig = Set.of(loa2Transaction); levelsOfAssuranceConfigValidator.validateAllTransactionsAreSupportedByIDPs(identityProviderConfig, transactionsConfig); }
@Test public void shouldNotThrowWhenAllIdpsSupportATransaction() { Set<IdentityProviderConfig> identityProviderConfig = Set.of(loa2Idp, loa1And2Idp); Set<TransactionConfig> transactionsConfig = Set.of(loa2Transaction); try { levelsOfAssuranceConfigValidator.validateAllTransactionsAreSupportedByIDPs(identityProviderConfig, transactionsConfig); } catch (Exception e) { fail("Expected exception not thrown"); } }
@Test public void shouldNotThrowWhenAnIdpsIsOnboardingAndDoesNotSupportATransaction() { Set<TransactionConfig> transactionsConfig = Set.of(loa1And2Transaction); final IdentityProviderConfig onboardingIdp = IdentityProviderConfigDataBuilder.anIdentityProviderConfigData() .withOnboarding(List.of("some-other-transaction-id")) .withSupportedLevelsOfAssurance(List.of(LevelOfAssurance.LEVEL_3)) .build(); Set<IdentityProviderConfig> identityProviderConfig = Set.of(onboardingIdp, loa1And2Idp); try { levelsOfAssuranceConfigValidator.validateAllTransactionsAreSupportedByIDPs(identityProviderConfig, transactionsConfig); } catch (Exception e) { fail("Expected exception not thrown"); } }