package de.gecheckt.pdf.umbenenner.application.port.out.modelcatalog;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;

/**
 * Tests for {@link ApiKeyOrigin}.
 */
class ApiKeyOriginTest {

    @Test
    void allValuesPresent() {
        assertThat(ApiKeyOrigin.values()).containsExactlyInAnyOrder(
                ApiKeyOrigin.FROM_PROVIDER_ENV_VAR,
                ApiKeyOrigin.FROM_LEGACY_ENV_VAR,
                ApiKeyOrigin.FROM_PROPERTY_FILE,
                ApiKeyOrigin.ABSENT);
    }

    @Test
    void enumLookupByName() {
        assertThat(ApiKeyOrigin.valueOf("FROM_PROVIDER_ENV_VAR")).isEqualTo(ApiKeyOrigin.FROM_PROVIDER_ENV_VAR);
        assertThat(ApiKeyOrigin.valueOf("FROM_LEGACY_ENV_VAR")).isEqualTo(ApiKeyOrigin.FROM_LEGACY_ENV_VAR);
        assertThat(ApiKeyOrigin.valueOf("FROM_PROPERTY_FILE")).isEqualTo(ApiKeyOrigin.FROM_PROPERTY_FILE);
        assertThat(ApiKeyOrigin.valueOf("ABSENT")).isEqualTo(ApiKeyOrigin.ABSENT);
    }
}
