From 91676531b88d8af7c0ed24ce32e563b5589f3fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E7=A0=81-=E6=96=B9=E6=99=93=E8=BE=89?= Date: Mon, 2 Feb 2026 07:52:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B5=8B=E8=AF=95=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=20MySQL=EF=BC=8C=E5=8F=96=E6=B6=88=E8=B7=B3?= =?UTF-8?q?=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 测试 application.yml 改为连接远程 pguser-db - 移除 surefire skipTests,移除 H2 依赖,增加 mysql-connector-j(test) --- pangu-system/pom.xml | 19 +++---------------- .../src/test/resources/application.yml | 13 +++++++------ 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/pangu-system/pom.xml b/pangu-system/pom.xml index 93c7411..76d040c 100644 --- a/pangu-system/pom.xml +++ b/pangu-system/pom.xml @@ -37,24 +37,11 @@ spring-boot-starter-test test - + - com.h2database - h2 + com.mysql + mysql-connector-j test - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - true - - - - diff --git a/pangu-system/src/test/resources/application.yml b/pangu-system/src/test/resources/application.yml index bd9a732..7f1c8b2 100644 --- a/pangu-system/src/test/resources/application.yml +++ b/pangu-system/src/test/resources/application.yml @@ -1,10 +1,10 @@ -# 测试环境配置,供 pangu-system 单模块测试使用 +# 测试环境配置,使用与 pangu-admin 相同的远程 MySQL spring: datasource: - driver-class-name: org.h2.Driver - url: jdbc:h2:mem:testdb;MODE=MySQL;DB_CLOSE_DELAY=-1;INIT=CREATE SCHEMA IF NOT EXISTS PUBLIC - username: sa - password: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://8.148.25.55:3306/pguser-db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: aly2024A mybatis-plus: mapper-locations: classpath*:mapper/**/*.xml @@ -13,6 +13,7 @@ mybatis-plus: map-underscore-to-camel-case: true pagehelper: - helper-dialect: h2 + helper-dialect: mysql reasonable: true support-methods-arguments: true + params: count=countSql