# suite模式下如何进行单元测试 好处不说了 ## 单元测试开发流程 1. 确定需要测试的接口 `Eval360RatingService#find360Score` 2. 在`tip-front`模块的`src/test/java`目录下新建对应的包 `com.minto.app.performance.service.impl` 3. 在刚刚新建的包下新建`Eval360RatingServiceImplTest`测试类 4. 该类需要继承`TestCase`基类 ```java import static org.junit.jupiter.api.Assertions.*; import com.minto.tip.test.TestCase; class Eval360RatingServiceImplTest extends TestCase { @Autowired private Eval360RatingService eval360RatingService; @Test void find360Score() throws BusinessException { // 测试接口 assertTrue(CollectionUtil.isNotEmpty(eval360RatingService.find360Score(565640502972926771L, List.of(ResourceEnum.ResourceTypeEnum.OrgPerson.getResourceKey(9010535345073767852L))))); } } ``` 5. 运行测试 ## 注意事项 1. 单元测试的代码只能写在`tip-front`模块下,写在其他模块没有效果。 2. 单元测试时也会启动整个环境,所以建议多个测试放在同一个测试类中进行测试