testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractIdentityProviderTest.java
/**
     * Test that verify email action is performed if email is provided and email trust is not enabled for the provider
     * 
     * @throws MessagingException
     * @throws IOException
     */
Test that verify email action is performed if email is provided and email trust is not enabled for the provider


Test that verify email action is performed if email is provided and email trust is not enabled for the provider
@Test
    public void testSuccessfulAuthenticationWithoutUpdateProfile_emailProvided_emailVerifyEnabled() throws IOException, MessagingException {
        getRealm().setVerifyEmail(true);
        brokerServerRule.stopSession(this.session, true);
        this.session = brokerServerRule.startSession();
        IdentityProviderModel identityProviderModel = getIdentityProviderModel();
        try {
            identityProviderModel.setUpdateProfileFirstLoginMode(IdentityProviderRepresentation.UPFLM_OFF);
            identityProviderModel.setTrustEmail(false);
            UserModel federatedUser = assertSuccessfulAuthenticationWithEmailVerification(identityProviderModel, "test-user", "test-user@localhost", false);
            assertFalse(federatedUser.getRequiredActions().contains(RequiredAction.VERIFY_EMAIL.name()));
        } finally {
            getRealm().setVerifyEmail(false);
        }
    }
@ Test public void testSuccessfulAuthenticationWithoutUpdateProfile_emailProvided_emailVerifyEnabled ( ) throws IOException , MessagingException { getRealm ( ) . setVerifyEmail ( true ) ; brokerServerRule . stopSession ( this . session , true ) ; this . session = brokerServerRule . startSession ( ) ; IdentityProviderModel identityProviderModel = getIdentityProviderModel ( ) ; try { identityProviderModel . setUpdateProfileFirstLoginMode ( IdentityProviderRepresentation . UPFLM_OFF ) ; identityProviderModel . setTrustEmail ( false ) ; UserModel federatedUser = assertSuccessfulAuthenticationWithEmailVerification ( identityProviderModel , "test-user" , "test-user@localhost" , false ) ; assertFalse ( federatedUser . getRequiredActions ( ) . contains ( RequiredAction . VERIFY_EMAIL . name ( ) ) ) ; } finally { getRealm ( ) . setVerifyEmail ( false ) ; } }
Test that verify email action is performed if email is provided and email trust is not enabled for the provider
Test that verify email action is performed if email is provided and email trust is not enabled for the provider
// email is verified now