feat: 优化单表测试用例

This commit is contained in:
wangyu 2022-12-09 08:49:26 +08:00
parent 073931b000
commit a0da723f5e
2 changed files with 46 additions and 0 deletions

View File

@ -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();
}
/**

View File

@ -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();
}
}