package de.accso.flexinale;

import de.accso.flexinale.application.Config;
import de.accso.flexinale.shared_kernel.DoNotCheckInArchitectureTests;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ActiveProfiles;

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

@SpringBootTest
@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
@ActiveProfiles("configtest")
@DoNotCheckInArchitectureTests
class FlexinaleModulith1OnionApplicationSpringConfigTest {

    @Autowired
    Config config;

    @Test
    void testLoadSpringConfig() {
        // arrange, act
        // nope, is loaded auto-magically by Spring, see application-configtest.properties

        // assert
        assertThat(config.getQuoteOnline()).isEqualTo(42);
        assertThat(config.getMinZeitZwischenVorfuehrungenInMinuten()).isEqualTo(42);
    }
}
