refactor(功能用例): 测试用例避免使用默认项目影响别的数据

This commit is contained in:
guoyuqi 2023-11-10 19:21:52 +08:00 committed by Craftsman
parent 58a5d95e80
commit 5d7de8fac9
3 changed files with 105 additions and 36 deletions

View File

@ -70,7 +70,7 @@ public class FunctionalCaseCommentControllerTests {
private static String sessionId; private static String sessionId;
private static String csrfToken; private static String csrfToken;
private static final String projectId = "100001100001"; private static final String projectId = "project-case-comment-test";
@Test @Test
@Order(0) @Order(0)
@ -98,6 +98,7 @@ public class FunctionalCaseCommentControllerTests {
NotificationExample notificationExample = new NotificationExample(); NotificationExample notificationExample = new NotificationExample();
notificationExample.createCriteria().andResourceIdEqualTo("xiaomeinvGTest").andResourceTypeEqualTo(NoticeConstants.TaskType.FUNCTIONAL_CASE_TASK); notificationExample.createCriteria().andResourceIdEqualTo("xiaomeinvGTest").andResourceTypeEqualTo(NoticeConstants.TaskType.FUNCTIONAL_CASE_TASK);
List<Notification> notifications = notificationMapper.selectByExampleWithBLOBs(notificationExample); List<Notification> notifications = notificationMapper.selectByExampleWithBLOBs(notificationExample);
System.out.println(JSON.toJSONString(notifications));
Assertions.assertFalse(notifications.isEmpty()); Assertions.assertFalse(notifications.isEmpty());
Assertions.assertEquals(2, notifications.size()); Assertions.assertEquals(2, notifications.size());
Assertions.assertTrue(StringUtils.equals(notifications.get(0).getReceiver(), "default-project-member-user-guo-1")); Assertions.assertTrue(StringUtils.equals(notifications.get(0).getReceiver(), "default-project-member-user-guo-1"));
@ -121,6 +122,7 @@ public class FunctionalCaseCommentControllerTests {
NotificationExample notificationExample = new NotificationExample(); NotificationExample notificationExample = new NotificationExample();
notificationExample.createCriteria().andResourceIdEqualTo(functionalCaseComment1.getCaseId()).andResourceTypeEqualTo(NoticeConstants.TaskType.FUNCTIONAL_CASE_TASK); notificationExample.createCriteria().andResourceIdEqualTo(functionalCaseComment1.getCaseId()).andResourceTypeEqualTo(NoticeConstants.TaskType.FUNCTIONAL_CASE_TASK);
List<Notification> notifications = notificationMapper.selectByExampleWithBLOBs(notificationExample); List<Notification> notifications = notificationMapper.selectByExampleWithBLOBs(notificationExample);
System.out.println(JSON.toJSONString(notifications));
Assertions.assertFalse(notifications.isEmpty()); Assertions.assertFalse(notifications.isEmpty());
Assertions.assertTrue(StringUtils.equals(notifications.get(0).getReceiver(), functionalCaseComment1.getNotifier())); Assertions.assertTrue(StringUtils.equals(notifications.get(0).getReceiver(), functionalCaseComment1.getNotifier()));
FunctionalCaseComment functionalCaseComment2 = functionalCaseCommentMapper.selectByPrimaryKey(functionalCaseComment1.getId()); FunctionalCaseComment functionalCaseComment2 = functionalCaseCommentMapper.selectByPrimaryKey(functionalCaseComment1.getId());
@ -325,6 +327,7 @@ public class FunctionalCaseCommentControllerTests {
notificationExample = new NotificationExample(); notificationExample = new NotificationExample();
notificationExample.createCriteria().andResourceIdEqualTo("xiaomeinvGTestOne").andResourceTypeEqualTo(NoticeConstants.TaskType.FUNCTIONAL_CASE_TASK); notificationExample.createCriteria().andResourceIdEqualTo("xiaomeinvGTestOne").andResourceTypeEqualTo(NoticeConstants.TaskType.FUNCTIONAL_CASE_TASK);
List<Notification> notificationUpdate2 = notificationMapper.selectByExampleWithBLOBs(notificationExample); List<Notification> notificationUpdate2 = notificationMapper.selectByExampleWithBLOBs(notificationExample);
System.out.println(JSON.toJSONString(notificationUpdate2));
Assertions.assertTrue(notifications.size()<notificationUpdate2.size()); Assertions.assertTrue(notifications.size()<notificationUpdate2.size());
} }
@ -371,6 +374,7 @@ public class FunctionalCaseCommentControllerTests {
NotificationExample notificationExample = new NotificationExample(); NotificationExample notificationExample = new NotificationExample();
notificationExample.createCriteria().andResourceIdEqualTo("xiaomeinvGTest").andResourceTypeEqualTo(NoticeConstants.TaskType.FUNCTIONAL_CASE_TASK).andReceiverEqualTo("default-project-member-user-guo-2"); notificationExample.createCriteria().andResourceIdEqualTo("xiaomeinvGTest").andResourceTypeEqualTo(NoticeConstants.TaskType.FUNCTIONAL_CASE_TASK).andReceiverEqualTo("default-project-member-user-guo-2");
List<Notification> notifications = notificationMapper.selectByExampleWithBLOBs(notificationExample); List<Notification> notifications = notificationMapper.selectByExampleWithBLOBs(notificationExample);
System.out.println(JSON.toJSONString(notifications));
Assertions.assertFalse(notifications.isEmpty()); Assertions.assertFalse(notifications.isEmpty());
System.out.println(JSON.toJSONString(notifications)); System.out.println(JSON.toJSONString(notifications));
Assertions.assertTrue(StringUtils.equals(notifications.get(0).getReceiver(), "default-project-member-user-guo-2")); Assertions.assertTrue(StringUtils.equals(notifications.get(0).getReceiver(), "default-project-member-user-guo-2"));

View File

@ -1,21 +1,79 @@
INSERT INTO organization(id, num, name, description, create_time, update_time, create_user, update_user, deleted, delete_user, delete_time) VALUE
('organization-case-comment-test', null, 'organization-case-comment-test', 'organization-case-comment-test', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', 'admin', 0, null, null);
INSERT INTO project (id, num, organization_id, name, description, create_user, update_user, create_time, update_time) VALUES
('project-case-comment-test', null, 'organization-case-comment-test', '用例评论项目', '系统默认创建的项目', 'admin', 'admin', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000),
('project-case-comment-test-1', null, 'organization-case-comment-test', '用例评论项目1', '系统默认创建的项目1', 'admin', 'admin', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000),
('project-case-comment-test-2', null, 'organization-case-comment-test', '用例评论项目2', '系统默认创建的项目2', 'admin', 'admin', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000),
('project-case-comment-test-3', null, 'organization-case-comment-test', '用例评论项目3', '系统默认创建的项目3', 'admin', 'admin', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000);
INSERT INTO project_robot(id, project_id, name, platform, webhook, type, app_key, app_secret, enable, create_user, create_time, update_user, update_time, description) VALUES ('test_comment_message_robot1', 'project-case-comment-test', '测试机器人1', 'IN_SITE', 'NONE', null, null, null, true, 'admin', unix_timestamp() * 1000,'admin', unix_timestamp() * 1000, null);
Insert into message_task(id, event, receiver, project_robot_id, task_type, test_id, project_id, enable, create_user, create_time, update_user, update_time, use_default_template, use_default_subject, subject)
VALUES ('case-comment_message1', 'UPDATE', 'CREATE_USER', 'test_comment_message_robot1', 'FUNCTIONAL_CASE_TASK', 'NONE', 'project-case-comment-test', true, 'admin', unix_timestamp() * 1000, 'admin', unix_timestamp() * 1000, true, true, 'message.title.functional_case_task_update');
INSERT INTO message_task_blob(id, template) VALUES ('case-comment_message1', 'message.functional_case_task_update');
Insert into message_task(id, event, receiver, project_robot_id, task_type, test_id, project_id, enable, create_user, create_time, update_user, update_time, use_default_template, use_default_subject, subject)
VALUES ('case-comment_message2', 'UPDATE', 'FOLLOW_PEOPLE', 'test_comment_message_robot1', 'FUNCTIONAL_CASE_TASK', 'NONE', 'project-case-comment-test', true, 'admin', unix_timestamp() * 1000, 'admin', unix_timestamp() * 1000, true, true, 'message.title.functional_case_task_update');
INSERT INTO message_task_blob(id, template) VALUES ('case-comment_message2', 'message.functional_case_task_update');
Insert into message_task(id, event, receiver, project_robot_id, task_type, test_id, project_id, enable, create_user, create_time, update_user, update_time, use_default_template, use_default_subject, subject)
VALUES ('case-comment_message3', 'DELETE', 'CREATE_USER', 'test_comment_message_robot1', 'FUNCTIONAL_CASE_TASK', 'NONE', 'project-case-comment-test', true, 'admin', unix_timestamp() * 1000, 'admin', unix_timestamp() * 1000, true, true, 'message.title.functional_case_task_delete');
INSERT INTO message_task_blob(id, template) VALUES ('case-comment_message3', 'message.functional_case_task_delete');
Insert into message_task(id, event, receiver, project_robot_id, task_type, test_id, project_id, enable, create_user, create_time, update_user, update_time, use_default_template, use_default_subject, subject)
VALUES ('case-comment_message4', 'REVIEW_PASSED', 'CREATE_USER', 'test_comment_message_robot1', 'FUNCTIONAL_CASE_TASK', 'NONE', 'project-case-comment-test', true, 'admin', unix_timestamp() * 1000, 'admin', unix_timestamp() * 1000, true, true, 'message.title.functional_case_task_review_passed');
INSERT INTO message_task_blob(id, template) VALUES ('case-comment_message4', 'message.functional_case_task_review');
Insert into message_task(id, event, receiver, project_robot_id, task_type, test_id, project_id, enable, create_user, create_time, update_user, update_time, use_default_template, use_default_subject, subject)
VALUES ('case-comment_message5', 'REVIEW_FAIL', 'CREATE_USER', 'test_comment_message_robot1', 'FUNCTIONAL_CASE_TASK', 'NONE', 'project-case-comment-test', true, 'admin', unix_timestamp() * 1000, 'admin', unix_timestamp() * 1000, true, true, 'message.title.functional_case_task_review_fail');
INSERT INTO message_task_blob(id, template) VALUES ('case-comment_message5', 'message.functional_case_task_review');
Insert into message_task(id, event, receiver, project_robot_id, task_type, test_id, project_id, enable, create_user, create_time, update_user, update_time, use_default_template, use_default_subject, subject)
VALUES ('case-comment_message6', 'EXECUTE_PASSED', 'CREATE_USER', 'test_comment_message_robot1', 'FUNCTIONAL_CASE_TASK', 'NONE', 'project-case-comment-test', true, 'admin', unix_timestamp() * 1000, 'admin', unix_timestamp() * 1000, true, true, 'message.title.functional_case_task_execute_passed');
INSERT INTO message_task_blob(id, template) VALUES ('case-comment_message6', 'message.functional_case_task_plan');
Insert into message_task(id, event, receiver, project_robot_id, task_type, test_id, project_id, enable, create_user, create_time, update_user, update_time, use_default_template, use_default_subject, subject)
VALUES ('case-comment_message7', 'EXECUTE_FAIL', 'CREATE_USER', 'test_comment_message_robot1', 'FUNCTIONAL_CASE_TASK', 'NONE', 'project-case-comment-test', true, 'admin', unix_timestamp() * 1000, 'admin', unix_timestamp() * 1000, true, true, 'message.title.functional_case_task_execute_fail');
INSERT INTO message_task_blob(id, template) VALUES ('case-comment_message7', 'message.functional_case_task_plan');
Insert into message_task(id, event, receiver, project_robot_id, task_type, test_id, project_id, enable, create_user, create_time, update_user, update_time, use_default_template, use_default_subject, subject)
VALUES ('case-comment_message8', 'COMMENT', 'CREATE_USER', 'test_comment_message_robot1', 'FUNCTIONAL_CASE_TASK', 'NONE', 'project-case-comment-test', true, 'admin', unix_timestamp() * 1000, 'admin', unix_timestamp() * 1000, true, true, 'message.title.functional_case_task_comment');
INSERT INTO message_task_blob(id, template) VALUES ('case-comment_message8', 'message.functional_case_task_comment');
Insert into message_task(id, event, receiver, project_robot_id, task_type, test_id, project_id, enable, create_user, create_time, update_user, update_time, use_default_template, use_default_subject, subject)
VALUES ('case-comment_message9', 'AT', 'NONE', 'test_comment_message_robot1', 'FUNCTIONAL_CASE_TASK', 'NONE', 'project-case-comment-test', true, 'admin', unix_timestamp() * 1000, 'admin', unix_timestamp() * 1000, true, true, 'message.title.functional_case_task_comment');
INSERT INTO message_task_blob(id, template) VALUES ('case-comment_message9', 'message.functional_case_task_at_comment');
Insert into message_task(id, event, receiver, project_robot_id, task_type, test_id, project_id, enable, create_user, create_time, update_user, update_time, use_default_template, use_default_subject, subject)
VALUES ('case-comment_message10', 'REPLY', 'NONE', 'test_comment_message_robot1', 'FUNCTIONAL_CASE_TASK', 'NONE', 'project-case-comment-test', true, 'admin', unix_timestamp() * 1000, 'admin', unix_timestamp() * 1000, true, true, 'message.title.functional_case_task_comment');
INSERT INTO message_task_blob(id, template) VALUES ('case-comment_message10', 'message.functional_case_task_reply_comment');
INSERT INTO functional_case(id, num, module_id, project_id, template_id, name, review_status, tags, case_edit_type, pos, INSERT INTO functional_case(id, num, module_id, project_id, template_id, name, review_status, tags, case_edit_type, pos,
version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user, version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user,
update_user, delete_user, create_time, update_time, delete_time) update_user, delete_user, create_time, update_time, delete_time)
VALUES ('xiaomeinvGTest', 1000001, 'test_guo', '100001100001', 'test_guo', 'gyqTest', 'UN_REVIEWED', null, 'text', VALUES ('xiaomeinvGTest', 1000001, 'test_guo', 'project-case-comment-test', 'test_guo', 'gyqTest', 'UN_REVIEWED', null, 'text',
10001, '111', 'xiaomeinvGTest', 'success', false, false, true, 'gyq', 'gyq', null, 1698058347559, 1698058347559, 10001, '111', 'xiaomeinvGTest', 'success', false, false, true, 'gyq', 'gyq', null, 1698058347559, 1698058347559,
null); null);
INSERT INTO functional_case(id, num, module_id, project_id, template_id, name, review_status, tags, case_edit_type, pos, INSERT INTO functional_case(id, num, module_id, project_id, template_id, name, review_status, tags, case_edit_type, pos,
version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user, version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user,
update_user, delete_user, create_time, update_time, delete_time) update_user, delete_user, create_time, update_time, delete_time)
VALUES ('xiaomeinvGTestOne', 1000001, 'test_guo', '100001100001', 'test_guo', 'gyqTest1', 'UN_REVIEWED', null, 'text', VALUES ('xiaomeinvGTestOne', 1000001, 'test_guo', 'project-case-comment-test', 'test_guo', 'gyqTest1', 'UN_REVIEWED', null, 'text',
10001, '111', 'xiaomeinvGTestOne', 'success', false, false, true, 'gyq', 'gyq', null, 1698058347559, 10001, '111', 'xiaomeinvGTestOne', 'success', false, false, true, 'gyq', 'gyq', null, 1698058347559,
1698058347559, 1698058347559,
null); null);
INSERT INTO functional_case_blob(id, steps, text_description, expected_result, prerequisite, description) VALUES ('xiaomeinvGTest', 'STEP', '1111', NULL, NULL, 'TEST');
INSERT INTO functional_case_blob(id, steps, text_description, expected_result, prerequisite, description) VALUES ('xiaomeinvGTestOne', 'STEP', '1111', NULL, NULL, 'TEST');
INSERT INTO user(id, name, email, password, create_time, update_time, language, last_organization_id, phone, source, INSERT INTO user(id, name, email, password, create_time, update_time, language, last_organization_id, phone, source,
last_project_id, create_user, update_user, deleted) last_project_id, create_user, update_user, deleted)
VALUES ('default-project-member-user-guo', 'default-project-member-user1', 'project-member-guo1@metersphere.io', VALUES ('default-project-member-user-guo', 'default-project-member-user1', 'project-member-guo1@metersphere.io',
@ -43,38 +101,38 @@ VALUES ('default-project-member-user-guo', 'default-project-member-user1', 'proj
NULL, NUll, '', 'LOCAL', NULL, 'admin', 'admin', 1); NULL, NUll, '', 'LOCAL', NULL, 'admin', 'admin', 1);
INSERT INTO user_role_relation (id, user_id, role_id, source_id, organization_id, create_time, create_user) INSERT INTO user_role_relation (id, user_id, role_id, source_id, organization_id, create_time, create_user)
VALUES (UUID(), 'default-project-member-user-guo', 'org_member', '100001', '100001', UNIX_TIMESTAMP() * 1000, 'admin'), VALUES (UUID(), 'default-project-member-user-guo', 'org_member', 'organization-case-comment-test', 'organization-case-comment-test', UNIX_TIMESTAMP() * 1000, 'admin'),
(UUID(), 'default-project-member-user-guo-1', 'org_member', '100001', '100001', UNIX_TIMESTAMP() * 1000, (UUID(), 'default-project-member-user-guo-1', 'org_member', 'organization-case-comment-test', 'organization-case-comment-test', UNIX_TIMESTAMP() * 1000,
'admin'), 'admin'),
(UUID(), 'default-project-member-user-guo-2', 'org_member', '100001', '100001', UNIX_TIMESTAMP() * 1000, (UUID(), 'default-project-member-user-guo-2', 'org_member', 'organization-case-comment-test', 'organization-case-comment-test', UNIX_TIMESTAMP() * 1000,
'admin'), 'admin'),
(UUID(), 'default-project-member-user-guo-3', 'org_member', '100001', '100001', UNIX_TIMESTAMP() * 1000, (UUID(), 'default-project-member-user-guo-3', 'org_member', 'organization-case-comment-test', 'organization-case-comment-test', UNIX_TIMESTAMP() * 1000,
'admin'), 'admin'),
(UUID(), 'default-project-member-user-guo-4', 'org_member', '100001', '100001', UNIX_TIMESTAMP() * 1000, (UUID(), 'default-project-member-user-guo-4', 'org_member', 'organization-case-comment-test', 'organization-case-comment-test', UNIX_TIMESTAMP() * 1000,
'admin'), 'admin'),
(UUID(), 'default-project-member-user-guo-5', 'org_member', '100001', '100001', UNIX_TIMESTAMP() * 1000, (UUID(), 'default-project-member-user-guo-5', 'org_member', 'organization-case-comment-test', 'organization-case-comment-test', UNIX_TIMESTAMP() * 1000,
'admin'), 'admin'),
(UUID(), 'default-project-member-user-guo-del', 'org_member', '100001', '100001', UNIX_TIMESTAMP() * 1000, (UUID(), 'default-project-member-user-guo-del', 'org_member', 'organization-case-comment-test', 'organization-case-comment-test', UNIX_TIMESTAMP() * 1000,
'admin'), 'admin'),
(UUID(), 'gyq', 'org_member', '100001', '100001', UNIX_TIMESTAMP() * 1000, (UUID(), 'gyq', 'org_member', 'organization-case-comment-test', 'organization-case-comment-test', UNIX_TIMESTAMP() * 1000,
'admin'); 'admin');
INSERT INTO user_role_relation (id, user_id, role_id, source_id, organization_id, create_time, create_user) INSERT INTO user_role_relation (id, user_id, role_id, source_id, organization_id, create_time, create_user)
VALUES (UUID(), 'default-project-member-user-guo', 'project_admin', '100001100001', '100001', UNIX_TIMESTAMP() * 1000, VALUES (UUID(), 'default-project-member-user-guo', 'project_admin', 'project-case-comment-test', 'organization-case-comment-test', UNIX_TIMESTAMP() * 1000,
'admin'), 'admin'),
(UUID(), 'default-project-member-user-guo-1', 'project_admin', '100001100001', '100001', UNIX_TIMESTAMP() * 1000, (UUID(), 'default-project-member-user-guo-1', 'project_admin', 'project-case-comment-test', 'organization-case-comment-test', UNIX_TIMESTAMP() * 1000,
'admin'), 'admin'),
(UUID(), 'default-project-member-user-guo-2', 'project_admin', '100001100001', '100001', UNIX_TIMESTAMP() * 1000, (UUID(), 'default-project-member-user-guo-2', 'project_admin', 'project-case-comment-test', 'organization-case-comment-test', UNIX_TIMESTAMP() * 1000,
'admin'), 'admin'),
(UUID(), 'default-project-member-user-guo-3', 'project_admin', '100001100001', '100001', UNIX_TIMESTAMP() * 1000, (UUID(), 'default-project-member-user-guo-3', 'project_admin', 'project-case-comment-test', 'organization-case-comment-test', UNIX_TIMESTAMP() * 1000,
'admin'), 'admin'),
(UUID(), 'default-project-member-user-guo-4', 'project_admin', '100001100001', '100001', UNIX_TIMESTAMP() * 1000, (UUID(), 'default-project-member-user-guo-4', 'project_admin', 'project-case-comment-test', 'organization-case-comment-test', UNIX_TIMESTAMP() * 1000,
'admin'), 'admin'),
(UUID(), 'default-project-member-user-guo-5', 'project_admin', '100001100001', '100001', UNIX_TIMESTAMP() * 1000, (UUID(), 'default-project-member-user-guo-5', 'project_admin', 'project-case-comment-test', 'organization-case-comment-test', UNIX_TIMESTAMP() * 1000,
'admin'), 'admin'),
(UUID(), 'default-project-member-user-guo-del', 'project_admin', '100001100001', '100001', (UUID(), 'default-project-member-user-guo-del', 'project_admin', 'project-case-comment-test', 'organization-case-comment-test',
UNIX_TIMESTAMP() * 1000, 'admin'), UNIX_TIMESTAMP() * 1000, 'admin'),
(UUID(), 'gyq', 'project_admin', '100001100001', '100001', UNIX_TIMESTAMP() * 1000, (UUID(), 'gyq', 'project_admin', 'project-case-comment-test', 'organization-case-comment-test', UNIX_TIMESTAMP() * 1000,
'admin'); 'admin');
INSERT INTO user_role_permission(id, role_id, permission_id) INSERT INTO user_role_permission(id, role_id, permission_id)

View File

@ -1,36 +1,43 @@
INSERT INTO organization(id, num, name, description, create_time, update_time, create_user, update_user, deleted, delete_user, delete_time) VALUE
('organization-case-trash-test', null, 'organization-case-trash-test', 'organization-case-trash-test', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', 'admin', 0, null, null);
INSERT INTO project (id, num, organization_id, name, description, create_user, update_user, create_time, update_time) VALUES
('project-case-trash-test', null, 'organization-case-trash-test', '用例回收项目', '系统默认创建的项目', 'admin', 'admin', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000),
('project-case-trash-test-1', null, 'organization-case-trash-test', '用例回收项目1', '系统默认创建的项目1', 'admin', 'admin', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000),
('project-case-trash-test-2', null, 'organization-case-trash-test', '用例回收项目2', '系统默认创建的项目2', 'admin', 'admin', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000),
('project-case-trash-test-3', null, 'organization-case-trash-test', '用例回收项目3', '系统默认创建的项目3', 'admin', 'admin', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000);
INSERT INTO template (id, name, remark, internal, update_time, create_time, create_user, scope_type, scope_id, enable_third_part, ref_id, scene)
VALUES ('test_template_case_trash_id', 'functional_case_trash_default', '', b'0', 1696992836000, 1696992836000, 'admin', 'PROJECT', 'project-case-trash-test', b'0', NULL, 'FUNCTIONAL');
INSERT INTO functional_case(id, num, module_id, project_id, template_id, name, review_status, tags, case_edit_type, pos, version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user, update_user, delete_user, create_time, update_time, delete_time) INSERT INTO functional_case(id, num, module_id, project_id, template_id, name, review_status, tags, case_edit_type, pos, version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user, update_user, delete_user, create_time, update_time, delete_time)
VALUES ('Trash_TEST_FUNCTIONAL_CASE_ID', 1, 'Trash_TEST_MOUDLE_ID', '100001100001', '100001', '回收站测试', 'UN_REVIEWED', NULL, 'STEP', 0, 'v1.0.0', 'Trash_TEST_FUNCTIONAL_CASE_ID', 'UN_EXECUTED', true, b'0', b'0', 'gyq', 'gyq', '', 1698058347559, 1698058347559, NULL); VALUES ('Trash_TEST_FUNCTIONAL_CASE_ID', 1, 'Trash_TEST_MOUDLE_ID', 'project-case-trash-test', '100001', '回收站测试', 'UN_REVIEWED', NULL, 'STEP', 0, 'v1.0.0', 'Trash_TEST_FUNCTIONAL_CASE_ID', 'UN_EXECUTED', true, b'0', b'0', 'gyq', 'gyq', '', 1698058347559, 1698058347559, NULL);
INSERT INTO functional_case(id, num, module_id, project_id, template_id, name, review_status, tags, case_edit_type, pos, version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user, update_user, delete_user, create_time, update_time, delete_time) INSERT INTO functional_case(id, num, module_id, project_id, template_id, name, review_status, tags, case_edit_type, pos, version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user, update_user, delete_user, create_time, update_time, delete_time)
VALUES ('Trash_TEST_FUNCTIONAL_CASE_ID_1', 2, 'Trash_TEST_MOUDLE_ID', '100001100001', '100001', '测试多版本', 'UN_REVIEWED', NULL, 'STEP', 0, 'v1.0.0', 'Trash_TEST_FUNCTIONAL_CASE_ID_1', 'UN_EXECUTED', true, b'0', b'0', 'gyq', 'gyq', '', 1698058347559, 1698058347559, NULL); VALUES ('Trash_TEST_FUNCTIONAL_CASE_ID_1', 2, 'Trash_TEST_MOUDLE_ID', 'project-case-trash-test', '100001', '测试多版本', 'UN_REVIEWED', NULL, 'STEP', 0, 'v1.0.0', 'Trash_TEST_FUNCTIONAL_CASE_ID_1', 'UN_EXECUTED', true, b'0', b'0', 'gyq', 'gyq', '', 1698058347559, 1698058347559, NULL);
INSERT INTO functional_case(id, num, module_id, project_id, template_id, name, review_status, tags, case_edit_type, pos, version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user, update_user, delete_user, create_time, update_time, delete_time) INSERT INTO functional_case(id, num, module_id, project_id, template_id, name, review_status, tags, case_edit_type, pos, version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user, update_user, delete_user, create_time, update_time, delete_time)
VALUES ('Trash_TEST_FUNCTIONAL_CASE_ID_2', 3, 'Trash_TEST_MOUDLE_ID', '100001100001', '100001', 'copy_测试多版本', 'UN_REVIEWED', NULL, 'STEP', 0, 'v2.0.0', 'Trash_TEST_FUNCTIONAL_CASE_ID_1', 'UN_EXECUTED', true, b'0', b'0', 'gyq', 'gyq', '', 1698058347559, 1698058347559, NULL); VALUES ('Trash_TEST_FUNCTIONAL_CASE_ID_2', 3, 'Trash_TEST_MOUDLE_ID', 'project-case-trash-test', '100001', 'copy_测试多版本', 'UN_REVIEWED', NULL, 'STEP', 0, 'v2.0.0', 'Trash_TEST_FUNCTIONAL_CASE_ID_1', 'UN_EXECUTED', true, b'0', b'0', 'gyq', 'gyq', '', 1698058347559, 1698058347559, NULL);
INSERT INTO functional_case(id, num, module_id, project_id, template_id, name, review_status, tags, case_edit_type, pos, version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user, update_user, delete_user, create_time, update_time, delete_time) INSERT INTO functional_case(id, num, module_id, project_id, template_id, name, review_status, tags, case_edit_type, pos, version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user, update_user, delete_user, create_time, update_time, delete_time)
VALUES ('Trash_TEST_FUNCTIONAL_CASE_ID_3', 3, 'Trash_TEST_MOUDLE_ID', '100001100001', '100001', 'copy_测试多版本', 'UN_REVIEWED', NULL, 'STEP', 0, 'v3.0.0', 'Trash_TEST_FUNCTIONAL_CASE_ID_1', 'UN_EXECUTED', true, b'0', b'0', 'gyq', 'gyq', '', 1698058347559, 1698058347559, NULL); VALUES ('Trash_TEST_FUNCTIONAL_CASE_ID_3', 3, 'Trash_TEST_MOUDLE_ID', 'project-case-trash-test', '100001', 'copy_测试多版本', 'UN_REVIEWED', NULL, 'STEP', 0, 'v3.0.0', 'Trash_TEST_FUNCTIONAL_CASE_ID_1', 'UN_EXECUTED', true, b'0', b'0', 'gyq', 'gyq', '', 1698058347559, 1698058347559, NULL);
INSERT INTO functional_case(id, num, module_id, project_id, template_id, name, review_status, tags, case_edit_type, pos, version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user, update_user, delete_user, create_time, update_time, delete_time) INSERT INTO functional_case(id, num, module_id, project_id, template_id, name, review_status, tags, case_edit_type, pos, version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user, update_user, delete_user, create_time, update_time, delete_time)
VALUES ('Trash_TEST_FUNCTIONAL_CASE_ID_4', 4, 'Trash_TEST_MOUDLE_ID', '100001100001', '100001', 'copy_测试多版本', 'UN_REVIEWED', NULL, 'STEP', 0, 'v3.0.0', 'Trash_TEST_FUNCTIONAL_CASE_ID', 'UN_EXECUTED',true, b'0', b'0', 'gyq', 'gyq', '', 1698058347559, 1698058347559, NULL); VALUES ('Trash_TEST_FUNCTIONAL_CASE_ID_4', 4, 'Trash_TEST_MOUDLE_ID', 'project-case-trash-test', '100001', 'copy_测试多版本', 'UN_REVIEWED', NULL, 'STEP', 0, 'v3.0.0', 'Trash_TEST_FUNCTIONAL_CASE_ID', 'UN_EXECUTED',true, b'0', b'0', 'gyq', 'gyq', '', 1698058347559, 1698058347559, NULL);
INSERT INTO functional_case_custom_field(case_id, field_id, value) VALUES ('Trash_TEST_FUNCTIONAL_CASE_ID', 'gyq_custom_id1', '22'); INSERT INTO functional_case_custom_field(case_id, field_id, value) VALUES ('Trash_TEST_FUNCTIONAL_CASE_ID', 'gyq_custom_id1', '22');
INSERT INTO functional_case_custom_field(case_id, field_id, value) VALUES ('Trash_TEST_FUNCTIONAL_CASE_ID', 'gyq_custom_id2', '33'); INSERT INTO functional_case_custom_field(case_id, field_id, value) VALUES ('Trash_TEST_FUNCTIONAL_CASE_ID', 'gyq_custom_id2', '33');
INSERT INTO custom_field(id, name, scene, `type`, remark, internal, scope_type, create_time, update_time, create_user, scope_id)
VALUES('gyq_custom_id1', 'functional_priority', 'FUNCTIONAL', 'SELECT', '', 1, 'ORGANIZATION', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', '100001');
INSERT INTO custom_field(id, name, scene, `type`, remark, internal, scope_type, create_time, update_time, create_user, scope_id) INSERT INTO custom_field(id, name, scene, `type`, remark, internal, scope_type, create_time, update_time, create_user, scope_id)
VALUES('gyq_custom_id2', 'level', 'FUNCTIONAL', 'SELECT', '', 1, 'ORGANIZATION', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', '100001'); VALUES('gyq_custom_id1', 'functional_priority', 'FUNCTIONAL', 'SELECT', '', 1, 'ORGANIZATION', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', 'test_template_case_trash_id');
INSERT INTO custom_field(id, name, scene, `type`, remark, internal, scope_type, create_time, update_time, create_user, scope_id)
VALUES('gyq_custom_id2', 'level', 'FUNCTIONAL', 'SELECT', '', 1, 'ORGANIZATION', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000, 'admin', 'test_template_case_trash_id');
INSERT INTO functional_case_comment(id, case_id, create_user, status, parent_id, resource_id, notifier, content, reply_user, create_time, update_time) INSERT INTO functional_case_comment(id, case_id, create_user, status, parent_id, resource_id, notifier, content, reply_user, create_time, update_time)
VALUES ('trash_comment_id', 'Trash_TEST_FUNCTIONAL_CASE_ID', 'gyq', null, null, null, 'gyq','你好', null, UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000); VALUES ('trash_comment_id', 'Trash_TEST_FUNCTIONAL_CASE_ID', 'gyq', null, null, null, 'gyq','你好', null, UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000);
INSERT INTO functional_case_blob(id, steps, text_description, expected_result, prerequisite, description) VALUES ('Trash_TEST_FUNCTIONAL_CASE_ID', 'STEP', '1111', NULL, NULL, 'TEST');
INSERT INTO functional_case_blob(id, steps, text_description, expected_result, prerequisite, description) VALUES ('Trash_TEST_FUNCTIONAL_CASE_ID_1', 'STEP', '1111', NULL, NULL, 'TEST');
INSERT INTO functional_case_blob(id, steps, text_description, expected_result, prerequisite, description) VALUES ('Trash_TEST_FUNCTIONAL_CASE_ID_2', 'STEP', '1111', NULL, NULL, 'TEST');
INSERT INTO functional_case_blob(id, steps, text_description, expected_result, prerequisite, description) VALUES ('Trash_TEST_FUNCTIONAL_CASE_ID_3', 'STEP', '1111', NULL, NULL, 'TEST');
INSERT INTO functional_case_blob(id, steps, text_description, expected_result, prerequisite, description) VALUES ('Trash_TEST_FUNCTIONAL_CASE_ID_4', 'STEP', '1111', NULL, NULL, 'TEST');