mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-23 07:25:07 +08:00
[fix] 修改标签
This commit is contained in:
@ -12,7 +12,7 @@ import java.io.IOException;
|
||||
/**
|
||||
* Redis 测试 Configuration,主要实现内嵌 Redis 的启动
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author hhyykk
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@Lazy(false) // 禁止延迟加载
|
||||
|
@ -21,7 +21,7 @@ import javax.sql.DataSource;
|
||||
* 因为我们在单元测试会使用 spring.main.lazy-initialization 为 true,开启延迟加载。此时,会导致 DataSourceInitializationConfiguration 初始化
|
||||
* 不过呢,当前类的实现代码,基本是复制 DataSourceInitializationConfiguration 的哈!
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author hhyykk
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnMissingBean(AbstractScriptDatabaseInitializer.class)
|
||||
|
@ -22,7 +22,7 @@ import org.springframework.test.context.jdbc.Sql;
|
||||
*
|
||||
* 相比 {@link BaseDbUnitTest} 来说,额外增加了内存 Redis
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author hhyykk
|
||||
*/
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = BaseDbAndRedisUnitTest.Application.class)
|
||||
@ActiveProfiles("unit-test") // 设置使用 application-unit-test 配置文件
|
||||
|
@ -19,7 +19,7 @@ import org.springframework.test.context.jdbc.Sql;
|
||||
*
|
||||
* 注意,Service 层同样适用。对于 Service 层的单元测试,我们针对自己模块的 Mapper 走的是 H2 内存数据库,针对别的模块的 Service 走的是 Mock 方法
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author hhyykk
|
||||
*/
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = BaseDbUnitTest.Application.class)
|
||||
@ActiveProfiles("unit-test") // 设置使用 application-unit-test 配置文件
|
||||
|
@ -6,7 +6,7 @@ import org.mockito.junit.jupiter.MockitoExtension;
|
||||
/**
|
||||
* 纯 Mockito 的单元测试
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author hhyykk
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
public class BaseMockitoUnitTest {
|
||||
|
@ -14,7 +14,7 @@ import org.springframework.test.context.ActiveProfiles;
|
||||
*
|
||||
* 相比 {@link BaseDbUnitTest} 来说,从内存 DB 改成了内存 Redis
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author hhyykk
|
||||
*/
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = BaseRedisUnitTest.Application.class)
|
||||
@ActiveProfiles("unit-test") // 设置使用 application-unit-test 配置文件
|
||||
|
@ -17,7 +17,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
/**
|
||||
* 单元测试,assert 断言工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author hhyykk
|
||||
*/
|
||||
public class AssertUtils {
|
||||
|
||||
|
@ -21,7 +21,7 @@ import java.util.stream.Stream;
|
||||
/**
|
||||
* 随机工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author hhyykk
|
||||
*/
|
||||
public class RandomUtils {
|
||||
|
||||
|
Reference in New Issue
Block a user