### Question:
StatementProviderImpl implements StatementProvider { public ConditionsProvider getConditionsProvider(SAML2Config saml2Config) throws TokenCreationException { String customProvider = saml2Config.getCustomConditionsProviderClassName(); if ((customProvider != null) && !customProvider.isEmpty()) { return createCustomProviderInstance(customProvider, ConditionsProvider.class); } return new DefaultConditionsProvider(); } @Inject  StatementProviderImpl(KeyInfoFactory keyInfoFactory); ConditionsProvider getConditionsProvider(SAML2Config saml2Config); SubjectProvider getSubjectProvider(SAML2Config saml2Config); AuthenticationStatementsProvider getAuthenticationStatementsProvider(SAML2Config saml2Config); AttributeStatementsProvider getAttributeStatementsProvider(SAML2Config saml2Config); AuthzDecisionStatementsProvider getAuthzDecisionStatementsProvider(SAML2Config saml2Config); AttributeMapper getAttributeMapper(SAML2Config saml2Config);  }### Answer:
@Test public void testCustomProvider() throws TokenCreationException { SAML2Config config = SAML2Config.builder() .customConditionsProviderClassName("org.forgerock.openam.sts.tokengeneration.saml2.statements.DefaultConditionsProvider") .spEntityId("http: .idpId("da_idp") .build(); StatementProvider statementProvider = Guice.createInjector(new MyModule()).getInstance(StatementProvider.class); assertTrue(statementProvider.getConditionsProvider(config) instanceof DefaultConditionsProvider); }
@Test(expectedExceptions = TokenCreationException.class) public void testSpeciousProvider() throws TokenCreationException { SAML2Config config = SAML2Config.builder() .customConditionsProviderClassName("faux_class_name") .spEntityId("http: .idpId("da_idp") .build(); StatementProvider statementProvider = Guice.createInjector(new MyModule()).getInstance(StatementProvider.class); statementProvider.getConditionsProvider(config); }