feat: 优化单表测试用例
This commit is contained in:
parent
073931b000
commit
a0da723f5e
@ -7,6 +7,7 @@ import group.flyfish.fluent.operations.JdbcTemplateFluentSQLOperations;
|
||||
import group.flyfish.framework.cases.FluentSqlTestCase;
|
||||
import group.flyfish.framework.cases.JdbcTestCase;
|
||||
import group.flyfish.framework.cases.MybatisTestCase;
|
||||
import group.flyfish.framework.cases.SingleTableTestCase;
|
||||
import org.junit.Test;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.jdbc.core.JdbcOperations;
|
||||
@ -46,6 +47,8 @@ public class FluentJdbcTest {
|
||||
);
|
||||
// 执行测试
|
||||
cases.forEach(TestCase::test);
|
||||
// 单表测试
|
||||
new SingleTableTestCase().test();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,43 @@
|
||||
package group.flyfish.framework.cases;
|
||||
|
||||
import group.flyfish.framework.TestCase;
|
||||
import group.flyfish.framework.entity.SaasTenant;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static group.flyfish.fluent.chain.SQL.select;
|
||||
|
||||
/**
|
||||
* 单表测试用例
|
||||
*
|
||||
* @author wangyu
|
||||
*/
|
||||
@TestCase.Name("单表查询测试")
|
||||
public class SingleTableTestCase extends AbstractTestCase<List<SaasTenant>> {
|
||||
|
||||
public SingleTableTestCase() {
|
||||
super(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
@Override
|
||||
public void initialize() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试运行逻辑
|
||||
*
|
||||
* @return 运行结果
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
@Override
|
||||
public List<SaasTenant> run() throws Exception {
|
||||
// 单表查询
|
||||
return select().from(SaasTenant.class).list();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user