TestApplication.java 1.16 KB
package com.bsth;

import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * 测试用的SpringBoot启动类。
 */
@EnableTransactionManagement
@SpringBootApplication
@ComponentScan(excludeFilters = {
        @ComponentScan.Filter(
                type = FilterType.ASSIGNABLE_TYPE,
                value = { Application.class, StartCommand.class, WebAppConfiguration.class, XDApplication.class }
        ),
        @ComponentScan.Filter(
                type = FilterType.CUSTOM,
                classes = { TestApplicationTypeFillter.class }
        )
})
public class TestApplication implements CommandLineRunner {
    @Override
    public void run(String... args) throws Exception {
        // TODO:其他初始化代码
    }

    public static void main(String[] args) throws Exception {
        SpringApplication.run(TestApplication.class, args);
    }
}