package incheon.config;

import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 테스트 환경용 WebMvc 설정
 * 인터셉터를 비활성화하여 인증 없이 테스트 가능
 */
@TestConfiguration
public class TestWebMvcConfig {
    
    @Bean
    @Primary
    public WebMvcConfigurer testWebMvcConfigurer() {
        return new WebMvcConfigurer() {
            @Override
            public void addInterceptors(InterceptorRegistry registry) {
                // 테스트 환경에서는 인터셉터를 등록하지 않음
                // 이렇게 하면 AuthenticInterceptor가 동작하지 않음
            }
        };
    }
}
