<commit_before>package org.apereo.cas.okta;

import org.apereo.cas.config.OktaConfigurationFactory;
import org.apereo.cas.configuration.CasConfigurationProperties;
import org.apereo.cas.util.MockWebServer;

import lombok.val;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.HttpStatus;

import java.io.EOFException;

import static org.junit.jupiter.api.Assertions.*;

/**
 * This is {@link OktaConfigurationFactoryTests}.
 *
 * @author <NAME>
 * @since 6.4.0
 */
@Tag("Authentication")
@SpringBootTest(classes = BaseOktaTests.SharedTestConfiguration.class, properties = {
    "cas.authn.okta.proxy-host=localhost",
    "cas.authn.okta.proxy-port=8516",
    "cas.authn.okta.organization-url=https://dev-159539.oktapreview.com",

    "cas.authn.attribute-repository.okta.organization-url=https://dev-668371.oktapreview.com",
    "cas.authn.attribute-repository.okta.api-token=<PASSWORD>",
    "cas.authn.attribute-repository.okta.proxy-host=localhost",
    "cas.authn.attribute-repository.okta.proxy-port=8923",
    "cas.authn.attribute-repository.okta.proxy-username=user",
    "cas.authn.attribute-repository.okta.proxy-password=<PASSWORD>",
    "cas.authn.attribute-repository.okta.client-id=dummy-client",
    "cas.authn.attribute-repository.okta.private-key.location=classpath:okta-private-key.pem"
})
public class OktaConfigurationFactoryTests {
    @Autowired
    private CasConfigurationProperties casProperties;

    @Test
    public void verifyOperation() {
        try (val webServer = new MockWebServer(8923, HttpStatus.OK)) {
            webServer.start();
            assertNotNull(OktaConfigurationFactory.buildAuthenticationClient(casProperties.getAuthn().getOkta()));
            assertThrows(EOFException.class, () -> OktaConfigurationFactory.buildClient(casProperties.getAuthn().getAttributeRepository().getOkta()));
        }

    }
}<commit_msg>fix tests<commit_after>package org.apereo.cas.okta;

import org.apereo.cas.config.OktaConfigurationFactory;
import org.apereo.cas.configuration.CasConfigurationProperties;
import org.apereo.cas.util.MockWebServer;

import lombok.val;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.HttpStatus;

import java.io.EOFException;

import static org.junit.jupiter.api.Assertions.*;

/**
 * This is {@link OktaConfigurationFactoryTests}.
 *
 * @author <NAME>
 * @since 6.4.0
 */
@Tag("Authentication")
@SpringBootTest(classes = BaseOktaTests.SharedTestConfiguration.class, properties = {
    "cas.authn.okta.proxy-host=localhost",
    "cas.authn.okta.proxy-port=8516",
    "cas.authn.okta.organization-url=https://dev-159539.oktapreview.com",

    "cas.authn.attribute-repository.okta.organization-url=https://dev-668371.oktapreview.com",
    "cas.authn.attribute-repository.okta.api-token=<PASSWORD>",
    "cas.authn.attribute-repository.okta.proxy-host=localhost",
    "cas.authn.attribute-repository.okta.proxy-port=8923",
    "cas.authn.attribute-repository.okta.proxy-username=user",
    "cas.authn.attribute-repository.okta.proxy-password=<PASSWORD>",
    "cas.authn.attribute-repository.okta.client-id=dummy-client",
    "cas.authn.attribute-repository.okta.private-key.location=classpath:okta-private-key.pem"
})
public class OktaConfigurationFactoryTests {
    @Autowired
    private CasConfigurationProperties casProperties;

    @Test
    public void verifyOperation() {
        try (val webServer = new MockWebServer(8923, HttpStatus.OK)) {
            webServer.start();
            assertNotNull(OktaConfigurationFactory.buildAuthenticationClient(casProperties.getAuthn().getOkta()));
            assertThrows(OAuth2TokenRetrieverException.class, () -> OktaConfigurationFactory.buildClient(casProperties.getAuthn().getAttributeRepository().getOkta()));
        }

    }
}
{'fraction_non_alphanumeric': 0.13382173382173382, 'fraction_numerical': 0.013431013431013432, 'mean_word_length': 4.785310734463277, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '425823', 'n_tokens_mistral': 1314, 'n_tokens_neox': 1270, 'n_words': 139}