package at.procon.dip.testsupport;

import at.procon.dip.config.JacksonConfig;
import at.procon.dip.domain.document.service.DocumentContentService;
import at.procon.dip.domain.document.service.DocumentRepresentationService;
import at.procon.dip.domain.document.service.DocumentService;
import at.procon.dip.domain.ted.config.TedProjectionProperties;
import at.procon.dip.domain.ted.search.TedStructuredSearchRepository;
import at.procon.dip.domain.ted.service.TedStructuredSearchService;
import at.procon.dip.domain.ted.web.TedStructuredSearchController;
import at.procon.dip.ingestion.config.DipIngestionProperties;
import at.procon.dip.search.config.DipSearchProperties;
import at.procon.dip.search.engine.fulltext.PostgresFullTextSearchEngine;
import at.procon.dip.search.engine.trigram.PostgresTrigramSearchEngine;
import at.procon.dip.search.plan.DefaultSearchPlanner;
import at.procon.dip.search.rank.DefaultSearchResultFusionService;
import at.procon.dip.search.rank.DefaultSearchScoreNormalizer;
import at.procon.dip.search.repository.DocumentFullTextSearchRepositoryImpl;
import at.procon.dip.search.repository.DocumentTrigramSearchRepositoryImpl;
import at.procon.dip.search.service.DefaultSearchOrchestrator;
import at.procon.dip.search.service.DocumentLexicalIndexService;
import at.procon.dip.search.service.SearchMetricsService;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.context.annotation.Import;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

@SpringBootConfiguration
@AutoConfigureMockMvc
@ImportAutoConfiguration({
        DataSourceAutoConfiguration.class,
        HibernateJpaAutoConfiguration.class,
        TransactionAutoConfiguration.class,
        JdbcTemplateAutoConfiguration.class
})
@EnableConfigurationProperties({DipIngestionProperties.class, DipSearchProperties.class, TedProjectionProperties.class})
@EntityScan(basePackages = {
        "at.procon.dip.domain.document.entity",
        "at.procon.dip.domain.tenant.entity",
        "at.procon.dip.domain.ted.entity",
        "at.procon.ted.model.entity"
})
@EnableJpaRepositories(basePackages = {
        "at.procon.dip.domain.document.repository",
        "at.procon.dip.domain.tenant.repository",
        "at.procon.dip.domain.ted.repository",
        "at.procon.ted.repository"
})
@Import({
        JacksonConfig.class,
        DocumentService.class,
        DocumentContentService.class,
        DocumentRepresentationService.class,
        DocumentLexicalIndexService.class,
        SearchTestDataFactory.class,
        DefaultSearchPlanner.class,
        DocumentFullTextSearchRepositoryImpl.class,
        DocumentTrigramSearchRepositoryImpl.class,
        PostgresFullTextSearchEngine.class,
        PostgresTrigramSearchEngine.class,
        DefaultSearchScoreNormalizer.class,
        DefaultSearchResultFusionService.class,
        SearchMetricsService.class,
        DefaultSearchOrchestrator.class,
        TedStructuredSearchRepository.class,
        TedStructuredSearchService.class,
        TedStructuredSearchController.class
})
public class TedStructuredSearchTestApplication {
}
