Skip to content

Commit

Permalink
chore-curd单元测试-调整测试class的位置
Browse files Browse the repository at this point in the history
  • Loading branch information
aruis committed Sep 4, 2024
1 parent 977740b commit 2a28cc0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.common.mapper.TypeRef;
import jakarta.inject.Inject;
import jakarta.ws.rs.Path;
import net.ximatai.muyun.ability.ITableCreateAbility;
import net.ximatai.muyun.ability.curd.std.ICURDAbility;
import net.ximatai.muyun.core.Scaffold;
import net.ximatai.muyun.database.IDatabaseAccess;
import net.ximatai.muyun.database.builder.Column;
import net.ximatai.muyun.database.builder.TableWrapper;
import net.ximatai.muyun.database.exception.MyDatabaseException;
import net.ximatai.muyun.domain.PageResult;
import net.ximatai.muyun.platform.controller.TestController;
import net.ximatai.muyun.model.PageResult;
import net.ximatai.muyun.testcontainers.PostgresTestResource;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand All @@ -22,7 +27,7 @@

@QuarkusTest
@QuarkusTestResource(value = PostgresTestResource.class, restrictToAnnotatedClass = true)
class TestControllerTest {
class TestBasicCURD {

@Inject
IDatabaseAccess databaseAccess;
Expand Down Expand Up @@ -208,3 +213,27 @@ void testDeleteNotFound() {
}

}

@Path("/test")
class TestController extends Scaffold implements ICURDAbility, ITableCreateAbility {

@Override
public String getSchemaName() {
return "test";
}

@Override
public String getMainTable() {
return "test_table";
}

@Override
public TableWrapper fitOutTable() {
return TableWrapper.withName(getMainTable())
.setSchema(getSchemaName())
.setPrimaryKey(Column.ID_POSTGRES)
.addColumn(Column.of("name").setType("varchar"))
.addColumn(Column.of("t_create").setDefaultValue("now()"));

}
}

This file was deleted.

0 comments on commit 2a28cc0

Please sign in to comment.