feat: 重构测试框架并优化代码结构
refactor(tests): 将e2e_tests迁移到tests_suite和api_integration_tests style: 为Java类添加文档注释 docs: 更新.gitignore和配置文件 test: 添加性能测试和Playwright测试脚本 chore: 清理旧测试文件和配置
This commit is contained in:
+6
@@ -5,6 +5,12 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
|
||||
import org.springframework.data.r2dbc.repository.config.EnableR2dbcRepositories;
|
||||
|
||||
/**
|
||||
* 管理系统应用启动类
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@ConfigurationPropertiesScan(basePackages = "cn.novalon.manage")
|
||||
@EnableR2dbcRepositories(basePackages = {"cn.novalon.manage.db.dao"})
|
||||
|
||||
+6
@@ -12,6 +12,12 @@ import org.springframework.context.annotation.Configuration;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* OpenAPI配置类
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@Configuration
|
||||
public class OpenApiConfig {
|
||||
|
||||
|
||||
+6
@@ -4,6 +4,12 @@ import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.codec.ServerCodecConfigurer;
|
||||
import org.springframework.web.reactive.config.WebFluxConfigurer;
|
||||
|
||||
/**
|
||||
* WebFlux配置类
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@Configuration
|
||||
public class WebFluxConfig implements WebFluxConfigurer {
|
||||
|
||||
|
||||
+6
@@ -6,6 +6,12 @@ import org.springframework.cloud.gateway.route.RouteLocator;
|
||||
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
/**
|
||||
* 网关应用启动类
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class GatewayApplication {
|
||||
|
||||
|
||||
+6
@@ -9,6 +9,12 @@ import reactor.core.publisher.Mono;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 操作日志服务实现类
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@Service
|
||||
public class OperationLogService implements IOperationLogService {
|
||||
|
||||
|
||||
+6
@@ -7,6 +7,12 @@ import org.springframework.stereotype.Service;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* 字典数据服务实现类
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@Service
|
||||
public class SysDictDataService implements ISysDictDataService {
|
||||
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 菜单服务实现类
|
||||
* 系统菜单服务实现类
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
|
||||
+6
@@ -16,6 +16,12 @@ import reactor.core.publisher.Mono;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 系统角色服务实现类
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@Service
|
||||
public class SysRoleService implements ISysRoleService {
|
||||
|
||||
|
||||
+6
@@ -2,6 +2,12 @@ package cn.novalon.manage.sys.dto.request;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 密码修改请求DTO
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
public class PasswordChangeRequest {
|
||||
|
||||
@NotBlank(message = "旧密码不能为空")
|
||||
|
||||
+6
@@ -4,6 +4,12 @@ import jakarta.validation.constraints.Email;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
||||
/**
|
||||
* 用户注册请求DTO
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
public class UserRegisterRequest {
|
||||
|
||||
@NotBlank(message = "用户名不能为空")
|
||||
|
||||
+6
@@ -2,6 +2,12 @@ package cn.novalon.manage.sys.dto.request;
|
||||
|
||||
import jakarta.validation.constraints.Email;
|
||||
|
||||
/**
|
||||
* 用户更新请求DTO
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
public class UserUpdateRequest {
|
||||
|
||||
private String email;
|
||||
|
||||
+6
@@ -1,5 +1,11 @@
|
||||
package cn.novalon.manage.sys.dto.response;
|
||||
|
||||
/**
|
||||
* 认证响应DTO
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
public class AuthResponse {
|
||||
|
||||
private String token;
|
||||
|
||||
+6
@@ -1,5 +1,11 @@
|
||||
package cn.novalon.manage.sys.dto.response;
|
||||
|
||||
/**
|
||||
* 文件预览响应DTO
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
public class FilePreviewResponse {
|
||||
private String fileName;
|
||||
private String fileType;
|
||||
|
||||
+6
@@ -2,6 +2,12 @@ package cn.novalon.manage.sys.dto.response;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 用户响应DTO
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
public class UserResponse {
|
||||
|
||||
private Long id;
|
||||
|
||||
+6
@@ -8,6 +8,12 @@ import org.springframework.web.reactive.function.server.ServerRequest;
|
||||
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* 系统配置处理器
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@Component
|
||||
public class SysConfigHandler {
|
||||
|
||||
|
||||
+6
@@ -10,6 +10,12 @@ import org.springframework.web.reactive.function.server.ServerRequest;
|
||||
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* 系统字典处理器
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@Component
|
||||
public class SysDictHandler {
|
||||
|
||||
|
||||
+6
@@ -8,6 +8,12 @@ import org.springframework.web.reactive.function.server.ServerRequest;
|
||||
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* 字典处理器
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@Component
|
||||
public class DictionaryHandler {
|
||||
|
||||
|
||||
+6
@@ -11,6 +11,12 @@ import org.springframework.web.reactive.function.server.ServerRequest;
|
||||
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* 系统日志处理器
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@Component
|
||||
public class SysLogHandler {
|
||||
|
||||
|
||||
+6
@@ -12,6 +12,12 @@ import org.springframework.web.reactive.function.server.ServerRequest;
|
||||
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* 系统菜单处理器
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@Component
|
||||
public class MenuHandler {
|
||||
|
||||
|
||||
+6
@@ -15,6 +15,12 @@ import org.springframework.web.reactive.function.server.ServerRequest;
|
||||
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* 系统角色处理器
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@Component
|
||||
@Tag(name = "角色管理", description = "角色相关操作")
|
||||
public class SysRoleHandler {
|
||||
|
||||
+6
@@ -8,6 +8,12 @@ import org.springframework.web.reactive.function.server.ServerRequest;
|
||||
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* 统计数据处理器
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@Component
|
||||
public class StatsHandler {
|
||||
|
||||
|
||||
+6
@@ -6,6 +6,12 @@ import org.springframework.context.annotation.Primary;
|
||||
import io.r2dbc.spi.ConnectionFactory;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
/**
|
||||
* 单元测试配置类
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@TestConfiguration
|
||||
public class UnitTestConfig {
|
||||
|
||||
|
||||
+6
@@ -18,6 +18,12 @@ import java.time.LocalDateTime;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
/**
|
||||
* 字典服务单元测试类
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class DictionaryServiceTest {
|
||||
|
||||
|
||||
+6
@@ -14,6 +14,12 @@ import reactor.test.StepVerifier;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
/**
|
||||
* 系统配置服务单元测试类
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class SysConfigServiceTest {
|
||||
|
||||
|
||||
+6
@@ -24,6 +24,12 @@ import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
/**
|
||||
* 角色服务单元测试类
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class SysRoleServiceTest {
|
||||
|
||||
|
||||
+6
@@ -25,6 +25,12 @@ import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
/**
|
||||
* 用户服务单元测试类
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class SysUserServiceTest {
|
||||
|
||||
|
||||
+6
@@ -18,6 +18,12 @@ import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
* 字典处理器单元测试类
|
||||
*
|
||||
* @author 张翔
|
||||
* @date 2026-03-14
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class DictionaryHandlerTest {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user