ScheduleTestApp.java
1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package com.bsth.service.schedule;
import com.bsth.service.schedule.impl.SchedulePlanRuleResultServiceImpl;
import com.bsth.service.schedule.impl.SchedulePlanServiceImpl;
import com.bsth.service.schedule.rules.MyDroolsConfiguration;
import com.bsth.service.schedule.utils.DataToolsServiceImpl;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.orm.jpa.EntityScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
/**
* 基础测试类(用于计划调度模块测试测试)。
* 配置计划调度的模块的用到的entity,repository,service
*
* 注意:测试环境下测试类 TestApp 和springdata的类不在统一级包里,必须指定EnableJpaRepositories
*/
@Configuration
@EntityScan(
basePackages = {"com.bsth.entity"}
)
@ComponentScan(
basePackages = {"com.bsth.repository", "com.bsth.service"},
useDefaultFilters = false,
includeFilters = {
@ComponentScan.Filter(
type = FilterType.ASSIGNABLE_TYPE,
value = SchedulePlanRuleResultServiceImpl.class
),
@ComponentScan.Filter(
type = FilterType.ASSIGNABLE_TYPE,
value = SchedulePlanServiceImpl.class
),
@ComponentScan.Filter(
type = FilterType.ASSIGNABLE_TYPE,
value = MyDroolsConfiguration.class
),
@ComponentScan.Filter(
type = FilterType.ASSIGNABLE_TYPE,
value = DataToolsServiceImpl.class
)
}
)
@EnableJpaRepositories(
basePackages = {"com.bsth.repository"}
)
@SpringBootApplication
public class ScheduleTestApp {
}