refactor: 将集成测试模块挪到领域逻辑domain模块中

This commit is contained in:
valarchie 2023-08-14 14:35:52 +08:00
parent aa0e1f91c5
commit 3e25d18463
13 changed files with 70 additions and 86 deletions

View File

@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.RestController;
/**
* 调度日志操作处理
*
* @author ruoyi
* @author valarchie
*/
@RestController
@RequestMapping("/api/order")

View File

@ -21,7 +21,7 @@ import org.springframework.stereotype.Service;
*/
@Service
@RequiredArgsConstructor
public class ConfigApplicationService {
public class ConfigApplicationService {
@NonNull
private ConfigModelFactory configModelFactory;

View File

@ -1,4 +1,4 @@
package com.agileboot.integrationtest;
package com.agileboot.integrationTest;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

View File

@ -1,6 +1,6 @@
package com.agileboot.integrationtest.db;
package com.agileboot.integrationTest.db;
import com.agileboot.integrationtest.IntegrationTestApplication;
import com.agileboot.integrationTest.IntegrationTestApplication;
import com.agileboot.orm.common.enums.ConfigKeyEnum;
import com.agileboot.orm.system.service.ISysConfigService;
import javax.annotation.Resource;
@ -12,7 +12,7 @@ import org.springframework.test.context.junit4.SpringRunner;
@SpringBootTest(classes = IntegrationTestApplication.class)
@RunWith(SpringRunner.class)
class SysConfigServiceImplTest {
class SysConfigServiceImplTest {
@Resource
ISysConfigService configService;

View File

@ -1,6 +1,6 @@
package com.agileboot.integrationtest.db;
package com.agileboot.integrationTest.db;
import com.agileboot.integrationtest.IntegrationTestApplication;
import com.agileboot.integrationTest.IntegrationTestApplication;
import com.agileboot.orm.system.service.ISysDeptService;
import javax.annotation.Resource;
import org.junit.jupiter.api.Assertions;

View File

@ -1,7 +1,7 @@
package com.agileboot.integrationtest.db;
package com.agileboot.integrationTest.db;
import cn.hutool.core.collection.CollUtil;
import com.agileboot.integrationtest.IntegrationTestApplication;
import com.agileboot.integrationTest.IntegrationTestApplication;
import com.agileboot.orm.system.entity.SysMenuEntity;
import com.agileboot.orm.system.service.ISysMenuService;
import java.util.List;

View File

@ -1,6 +1,6 @@
package com.agileboot.integrationtest.db;
package com.agileboot.integrationTest.db;
import com.agileboot.integrationtest.IntegrationTestApplication;
import com.agileboot.integrationTest.IntegrationTestApplication;
import com.agileboot.orm.system.service.ISysPostService;
import javax.annotation.Resource;
import org.junit.jupiter.api.Assertions;

View File

@ -1,6 +1,6 @@
package com.agileboot.integrationtest.db;
package com.agileboot.integrationTest.db;
import com.agileboot.integrationtest.IntegrationTestApplication;
import com.agileboot.integrationTest.IntegrationTestApplication;
import com.agileboot.orm.system.service.ISysRoleService;
import javax.annotation.Resource;
import org.junit.jupiter.api.Assertions;

View File

@ -1,9 +1,9 @@
package com.agileboot.integrationtest.db;
package com.agileboot.integrationTest.db;
import com.agileboot.domain.system.role.query.AllocatedRoleQuery;
import com.agileboot.domain.system.role.query.UnallocatedRoleQuery;
import com.agileboot.domain.system.user.query.SearchUserQuery;
import com.agileboot.integrationtest.IntegrationTestApplication;
import com.agileboot.integrationTest.IntegrationTestApplication;
import com.agileboot.orm.system.entity.SysMenuEntity;
import com.agileboot.orm.system.entity.SysPostEntity;
import com.agileboot.orm.system.entity.SysRoleEntity;

View File

@ -0,0 +1,53 @@
# 数据源配置
spring:
datasource:
# 驱动
driver-class-name: org.h2.Driver
dynamic:
primary: master
strict: false
datasource:
master:
# h2 内存数据库 内存模式连接配置 库名: agileboot
url: jdbc:h2:mem:agileboot;DB_CLOSE_DELAY=-1
h2:
# 开启console 访问 默认false
console:
enabled: true
settings:
# 开启h2 console 跟踪 方便调试 默认 false
trace: true
# 允许console 远程访问 默认false
web-allow-others: true
# h2 访问路径上下文
path: /h2-console
sql:
init:
platform: mysql
# 初始化数据
schema-locations: classpath:h2sql/agileboot_schema.sql
data-locations: classpath:h2sql/agileboot_data.sql
# redis 配置
redis:
# 地址
host: localhost
# 端口默认为6379
port: 36379
# 数据库索引
database: 0
# 连接超时时间
timeout: 10s
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms

View File

@ -9,7 +9,7 @@ spring:
agileboot:
embedded:
mysql: true
redis: true
redis: false

View File

@ -1,68 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>agileboot</artifactId>
<groupId>com.agileboot</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>agileboot-integration-test</artifactId>
<description>
集成测试模块
</description>
<dependencies>
<dependency>
<groupId>com.agileboot</groupId>
<artifactId>agileboot-common</artifactId>
</dependency>
<!-- 核心模块 -->
<dependency>
<groupId>com.agileboot</groupId>
<artifactId>agileboot-infrastructure</artifactId>
</dependency>
<!-- 系统模块 -->
<dependency>
<groupId>com.agileboot</groupId>
<artifactId>agileboot-orm</artifactId>
</dependency>
<!-- 业务模块 -->
<dependency>
<groupId>com.agileboot</groupId>
<artifactId>agileboot-domain</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<resources>
<!-- mapper.xml文件在java目录下 -->
<resource>
<directory>src/main/test</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
</build>
</project>

View File

@ -282,7 +282,6 @@
<module>agileboot-domain</module>
<module>agileboot-infrastructure</module>
<module>agileboot-orm</module>
<module>agileboot-integration-test</module>
</modules>
<packaging>pom</packaging>