{
  "create_event_trigger": [
    {
      "name": "Create DDL_COMMAND_END Event Trigger",
      "url": "/browser/event_trigger/obj/",
      "is_positive_test": true,
      "test_data": {
        "enabled": "O",
        "eventfunname": "PLACE_HOLDER",
        "eventname": "ddl_command_start",
        "eventowner": "PLACE_HOLDER",
        "name": "PLACE_HOLDER"
      },
      "parameters_to_compare": [
        "enabled",
        "eventname",
        "eventowner",
        "name"
      ],
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Create SQL_DROP Event Trigger",
      "url": "/browser/event_trigger/obj/",
      "is_positive_test": true,
      "test_data": {
        "enabled": "O",
        "eventfunname": "PLACE_HOLDER",
        "eventname": "ddl_command_start",
        "eventowner": "PLACE_HOLDER",
        "name": "PLACE_HOLDER"
      },
      "parameters_to_compare": [
        "enabled",
        "eventname",
        "eventowner",
        "name"
      ],
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Create DDL_COMMAND_START Event Trigger",
      "url": "/browser/event_trigger/obj/",
      "is_positive_test": true,
      "test_data": {
        "enabled": "O",
        "eventfunname": "PLACE_HOLDER",
        "eventname": "ddl_command_start",
        "eventowner": "PLACE_HOLDER",
        "name": "PLACE_HOLDER"
      },
      "parameters_to_compare": [
        "enabled",
        "eventname",
        "eventowner",
        "name"
      ],
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while creating a Event Trigger",
      "url": "/browser/event_trigger/obj/",
      "error_creating_event_trigger": true,
      "is_positive_test": false,
      "test_data": {
        "enabled": "O",
        "eventfunname": "PLACE_HOLDER",
        "eventname": "DDL_COMMAND_END",
        "eventowner": "PLACE_HOLDER",
        "name": "PLACE_HOLDER",
        "providers": []
      },
      "parameters_to_compare": [
      ],
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_scalar",
        "return_value": "(False, 'Mocked Internal Server Error while creating a event trigger')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Internal server error",
      "url": "/browser/event_trigger/obj/",
      "internal_server_error": true,
      "is_positive_test": false,
      "test_data": {
        "enabled": "O",
        "eventfunname": "PLACE_HOLDER",
        "eventname": "DDL_COMMAND_END",
        "eventowner": "PLACE_HOLDER",
        "name": "PLACE_HOLDER",
        "providers": []
      },
      "parameters_to_compare": [
        "name",
        "eventname",
        "eventowner",
        "eventfunname"
      ],
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_scalar",
        "return_value": "(True, True), (False, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Error while getting oid of newly created event trigger",
      "url": "/browser/event_trigger/obj/",
      "error_getting_event_trigger_oid": true,
      "is_positive_test": false,
      "test_data": {
        "enabled": "O",
        "eventfunname": "PLACE_HOLDER",
        "eventname": "DDL_COMMAND_END",
        "eventowner": "PLACE_HOLDER",
        "name": "PLACE_HOLDER",
        "providers": []
      },
      "parameters_to_compare": [
      ],
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_scalar",
        "return_value": "(True, True), (True, True), (False, 'Mocked Internal Server Error while getting oid of created event trigger')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Create DDL_COMMAND_END Event Trigger with less parameter",
      "url": "/browser/event_trigger/obj/",
      "is_positive_test": false,
      "parameter_missing": true,
      "test_data": {
        "enabled": "O",
        "eventfunname": "PLACE_HOLDER",
        "eventname": "ddl_command_start",
        "eventowner": "PLACE_HOLDER",
        "name": "PLACE_HOLDER"
      },
      "parameters_to_compare": [
        "enabled",
        "eventname",
        "eventowner",
        "name"
      ],
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 400
      }
    }
  ],
  "get_event_trigger": [
    {
      "name": "Get Event Trigger",
      "url": "/browser/event_trigger/obj/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching a Event Trigger",
      "url": "/browser/event_trigger/obj/",
      "error_fetching_event_trigger": true,
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error while fetching a event trigger')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Fetch event trigger using wrong event trigger id",
      "url": "/browser/event_trigger/obj/",
      "wrong_event_trigger_id": true,
      "is_positive_test": false,
      "mocking_required": false,
      "mock_data": {
      },
      "expected_data": {
        "status_code": 410
      }
    },
    {
      "name": "Get Event Trigger list",
      "url": "/browser/event_trigger/obj/",
      "is_positive_test": true,
      "event_trigger_list": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching a Event Trigger list",
      "url": "/browser/event_trigger/obj/",
      "error_fetching_event_trigger": true,
      "is_positive_test": false,
      "event_trigger_list": true,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error while fetching a event trigger')"
      },
      "expected_data": {
        "status_code": 500
      }
    }
  ],
  "delete_event_trigger": [
    {
      "name": "delete Event Trigger",
      "url": "/browser/event_trigger/obj/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while deleting a Event Trigger",
      "url": "/browser/event_trigger/obj/",
      "error_deleting_event_trigger": true,
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_scalar",
        "return_value": "(False, 'Mocked Internal Server Error while deleting a event trigger')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "delete event trigger using wrong event trigger id",
      "url": "/browser/event_trigger/obj/",
      "wrong_event_trigger_id": true,
      "is_positive_test": false,
      "mocking_required": false,
      "mock_data": {
      },
      "expected_data": {
        "status_code": 410
      }
    },
    {
      "name": "Error while deleting a created Event Trigger",
      "url": "/browser/event_trigger/obj/",
      "error_deleting_created_event_trigger": true,
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_scalar",
        "return_value": "(True, True),(False, 'Mocked Internal Server Error while deleting a event trigger')"
      },
      "expected_data": {
        "status_code": 500
      }
    }
  ],
  "update_event_trigger": [
    {
      "name": "Update Event Trigger",
      "url": "/browser/event_trigger/obj/",
      "is_positive_test": true,
      "mocking_required": false,
      "test_data": {
        "comment": "This is event trigger update comment",
        "id": "PLACE_HOLDER"
      },
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while updating a Event Trigger",
      "url": "/browser/event_trigger/obj/",
      "error_updating_event_trigger": true,
      "test_data": {
        "comment": "This is event trigger update comment",
        "id": "PLACE_HOLDER"
      },
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_scalar",
        "return_value": "(False, 'Mocked Internal Server Error while fetching a event trigger')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Update event trigger using wrong event trigger id",
      "url": "/browser/event_trigger/obj/",
      "wrong_event_trigger_id": true,
      "is_positive_test": false,
      "test_data": {
        "comment": "This is event trigger update comment",
        "id": "PLACE_HOLDER"
      },
      "mocking_required": false,
      "mock_data": {
      },
      "expected_data": {
        "status_code": 410
      }
    },
    {
      "name": "Error while updating a Event Trigger",
      "url": "/browser/event_trigger/obj/",
      "error_in_db": true,
      "is_positive_test": false,
      "test_data": {
        "comment": "This is event trigger update comment",
        "id": "PLACE_HOLDER"
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.browser.server_groups.servers.databases.event_triggers.EventTriggerView.get_sql",
        "return_value": "('')"
      },
      "expected_data": {
        "status_code": 200
      }
    }
  ],
  "dependency_dependent_event_trigger": [
    {
      "name": "Get Event Trigger dependency",
      "url": "/browser/event_trigger/dependency/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Get Event Trigger dependent",
      "url": "/browser/event_trigger/dependent/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    }
  ],
  "get_event_trigger_nodes_and_node": [
    {
      "name": "Get Event Trigger nodes",
      "url": "/browser/event_trigger/nodes/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching a Event Trigger nodes",
      "url": "/browser/event_trigger/nodes/",
      "error_fetching_event_trigger": true,
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_2darray",
        "return_value": "(False, 'Mocked Internal Server Error while fetching a event trigger nodes')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Get Event Trigger node",
      "url": "/browser/event_trigger/nodes/",
      "is_positive_test": true,
      "node": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching a Event Trigger node",
      "url": "/browser/event_trigger/nodes/",
      "error_fetching_event_trigger": true,
      "is_positive_test": false,
      "node": true,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_2darray",
        "return_value": "(False, 'Mocked Internal Server Error while fetching a event trigger nodes')"
      },
      "expected_data": {
        "status_code": 500
      }
    }
  ],
  "get_event_trigger_sql": [
    {
      "name": "Get Event Trigger SQL",
      "url": "/browser/event_trigger/sql/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching a created Event Trigger sql",
      "url": "/browser/event_trigger/sql/",
      "error_fetching_event_trigger": true,
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error while fetching a event trigger sql')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Error while fetching a DB created Event Trigger sql",
      "url": "/browser/event_trigger/sql/",
      "error_fetching_event_trigger_db": true,
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_scalar",
        "return_value": "(False, 'Mocked Internal Server Error while fetching a DB created Event Trigger sql')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Get modified Event Trigger SQL",
      "url": "/browser/event_trigger/msql/",
      "is_positive_test": true,
      "mocking_required": false,
      "msql": true,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Get modified Event Trigger SQL when no trigger function passed",
      "url": "/browser/event_trigger/msql/",
      "is_positive_test": false,
      "error_fetching_event_trigger_msql": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 500
      }
    }
  ],
  "get_event_trigger_functions": [
    {
      "name": "Get Event Trigger functions",
      "url": "/browser/event_trigger/fopts/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching a Event Trigger functions",
      "url": "/browser/event_trigger/fopts/",
      "error_fetching_event_trigger": true,
      "is_positive_test": false,
      "event_trigger_functions": true,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_2darray",
        "return_value": "(False, 'Mocked Internal Server Error while fetching a event trigger functions')"
      },
      "expected_data": {
        "status_code": 500
      }
    }
  ],
  "delete_multiple_event_trigger" :[
    {
      "name": "Delete multiple Event Trigger",
      "url": "/browser/event_trigger/obj/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    }
  ]
}
