Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hezhangjian committed Feb 27, 2023
1 parent 680812a commit b7c00b2
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ INSERT INTO Namespace (Id, AppId, ClusterName, NamespaceName) VALUES (100, 'some

INSERT INTO Item (NamespaceId, "Key", "Type", "Value", Comment) VALUES (100, 'k1', '0', 'v1', 'comment1');
INSERT INTO Item (NamespaceId, "Key", "Type", "Value", Comment) VALUES (100, 'k2', '0', 'v2', 'comment1');
INSERT INTO Item (NamespaceId, "Key", "Type", "Value", Comment) VALUES (100, 'k3', '0', 'v3', 'comment1');
INSERT INTO Item (NamespaceId, "Key", "Type", "Value", Comment) VALUES (100, 'k3', '0', 'v3', 'comment1');
2 changes: 1 addition & 1 deletion apollo-biz/src/test/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spring.cloud.consul.enabled=false
spring.cloud.zookeeper.enabled=false
spring.cloud.discovery.enabled=false

spring.datasource.url = jdbc:h2:mem:~/apolloconfigdb;mode=mysql;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1;BUILTIN_ALIAS_OVERRIDE=TRUE;
spring.datasource.url = jdbc:h2:mem:~/apolloconfigdb;mode=mysql;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1;BUILTIN_ALIAS_OVERRIDE=TRUE

spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
spring.jpa.hibernate.globally_quoted_identifiers=false
Expand Down
2 changes: 1 addition & 1 deletion apollo-portal/src/test/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spring.cloud.consul.enabled=false
spring.cloud.zookeeper.enabled=false
spring.cloud.discovery.enabled=false

spring.datasource.url = jdbc:h2:mem:~/apolloportaldb;mode=mysql;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1
spring.datasource.url = jdbc:h2:mem:~/apolloportaldb;mode=mysql;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1;BUILTIN_ALIAS_OVERRIDE=TRUE

spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
spring.jpa.hibernate.globally_quoted_identifiers=false
Expand Down
19 changes: 19 additions & 0 deletions apollo-portal/src/test/resources/import.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,23 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
ALTER TABLE Consumer ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL;
ALTER TABLE Consumer ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL;
ALTER TABLE ConsumerToken ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL;
ALTER TABLE ConsumerToken ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL;
ALTER TABLE ConsumerRole ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL;
ALTER TABLE ConsumerRole ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL;
ALTER TABLE Role ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL;
ALTER TABLE Role ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL;
ALTER TABLE UserRole ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL;
ALTER TABLE UserRole ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL;
ALTER TABLE Permission ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL;
ALTER TABLE Permission ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL;
ALTER TABLE RolePermission ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL;
ALTER TABLE RolePermission ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL;
ALTER TABLE AppNamespace ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL;
ALTER TABLE AppNamespace ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL;
ALTER TABLE AppNamespace ALTER COLUMN Format VARCHAR(255) NULL;
ALTER TABLE APP ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL;
ALTER TABLE ServerConfig ALTER COLUMN COMMENT VARCHAR(255) NULL;
CREATE ALIAS IF NOT EXISTS UNIX_TIMESTAMP FOR "com.ctrip.framework.apollo.common.jpa.H2Function.unixTimestamp";
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
ALTER TABLE ConsumerRole ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL;
ALTER TABLE ConsumerRole ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL;
INSERT INTO `consumerrole` (`Id`, `ConsumerId`, `RoleId`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)
VALUES (890, 1, 990, 'someOperator', 'someOperator');
INSERT INTO `consumerrole` (`Id`, `ConsumerId`, `RoleId`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
ALTER TABLE Permission ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL;
ALTER TABLE Permission ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL;
INSERT INTO `permission` (`Id`, `PermissionType`, `TargetId`) VALUES (990, 'somePermissionType', 'someTargetId');
INSERT INTO `permission` (`Id`, `PermissionType`, `TargetId`) VALUES (991, 'anotherPermissionType', 'anotherTargetId');
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
ALTER TABLE RolePermission ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL;
ALTER TABLE RolePermission ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL;
INSERT INTO `rolepermission` (`Id`, `RoleId`, `PermissionId`) VALUES (990, 990, 990);
INSERT INTO `rolepermission` (`Id`, `RoleId`, `PermissionId`) VALUES (991, 990, 991);
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
ALTER TABLE Role ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL;
ALTER TABLE Role ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL;
INSERT INTO `role` (`Id`, `RoleName`) VALUES (990, 'someRoleName');
INSERT INTO `role` (`Id`, `RoleName`) VALUES (991, 'anotherRoleName');
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
ALTER TABLE UserRole ALTER COLUMN DataChange_CreatedBy VARCHAR(255) NULL;
ALTER TABLE UserRole ALTER COLUMN DataChange_CreatedTime TIMESTAMP NULL;
INSERT INTO `userrole` (`Id`, `UserId`, `RoleId`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)
VALUES (990, 'someUser', 990, 'someOperator', 'someOperator');
INSERT INTO `userrole` (`Id`, `UserId`, `RoleId`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)
Expand Down

0 comments on commit b7c00b2

Please sign in to comment.