{
  "add_subscription": [
    {
      "name": "Create subscription along with few publications",
      "url": "/browser/subscription/obj/",
      "is_positive_test": true,
      "test_data": {
        "username": "postgres",
        "name": "PLACEHOLDER",
        "connect": false,
        "copy_data": false,
        "create_slot": false,
        "db": "postgres",
        "subowner": "<OWNER>",
        "enabled": false,
        "host": "localhost",
        "slot_name": "None",
        "service": "",
        "port": 5432,
        "password": "",
        "sync": "off",
        "binary": false,
        "two_phase": false,
        "disable_on_error": false,
        "streaming": false,
        "password_required": true,
        "run_as_owner": false,
        "failover": false,
        "origin": "any",
        "pub": [
          "sample__1"
        ]
      },
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Create a subscription without name",
      "url": "/browser/subscription/obj/",
      "is_positive_test": false,
      "without_name": true,
      "test_data": {
        "username": "postgres",
        "name": "PLACEHOLDER",
        "connect": false,
        "copy_data": false,
        "create_slot": false,
        "db": "postgres",
        "subowner": "<OWNER>",
        "enabled": false,
        "host": "localhost",
        "slot_name": "None",
        "service": "",
        "port": 5432,
        "password": "",
        "sync": "off",
        "binary": false,
        "two_phase": false,
        "disable_on_error": false,
        "streaming": false,
        "password_required": true,
        "run_as_owner": false,
        "origin": "any",
        "pub": [
          "sample__1"
        ]
      },
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 410
      }
    },
    {
      "name": "Error while adding a subscription",
      "url": "/browser/subscription/obj/",
      "is_positive_test": false,
      "error_creating_subscription": true,
      "test_data": {
        "username": "postgres",
        "name": "PLACEHOLDER",
        "connect": false,
        "copy_data": false,
        "create_slot": false,
        "db": "postgres",
        "subowner": "<OWNER>",
        "enabled": false,
        "host": "localhost",
        "slot_name": "None",
        "service": "",
        "port": 5432,
        "password": "",
        "sync": "off",
        "binary": false,
        "two_phase": false,
        "disable_on_error": false,
        "streaming": false,
        "password_required": true,
        "run_as_owner": false,
        "origin": "any",
        "pub": [
          "sample__1"
        ]
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error ')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Exception while adding a subscription",
      "url": "/browser/subscription/obj/",
      "is_positive_test": false,
      "test_data": {
        "username": "postgres",
        "name": "PLACEHOLDER",
        "connect": false,
        "copy_data": false,
        "create_slot": false,
        "db": "postgres",
        "subowner": "<OWNER>",
        "enabled": false,
        "host": "localhost",
        "slot_name": "None",
        "service": "",
        "port": 5432,
        "password": "",
        "sync": "off",
        "binary": false,
        "two_phase": false,
        "disable_on_error": false,
        "streaming": false,
        "password_required": true,
        "run_as_owner": false,
        "origin": "any",
        "pub": [
          "sample__1"
        ]
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_dict",
        "return_value": "(True, True)(False, 'Mocked Internal Server Error ')"
      },
      "expected_data": {
        "status_code": 500
      }
    }
  ],
  "get_subscription": [
    {
      "name": "Get a subscription URL",
      "url": "/browser/subscription/obj/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching a subscription properties",
      "url": "/browser/subscription/obj/",
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Get a subscription properties under database nodes",
      "url": "/browser/subscription/obj/",
      "is_positive_test": true,
      "database_nodes": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching a subscription properties under database nodes",
      "url": "/browser/subscription/obj/",
      "is_positive_test": false,
      "database_nodes": true,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Get a subscription Node",
      "url": "/browser/subscription/nodes/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Get a subscription Node dependants",
      "url": "/browser/subscription/dependent/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Get a subscription Node dependency",
      "url": "/browser/subscription/dependency/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching the subscription under the database nodes using wrong database id",
      "url": "/browser/subscription/nodes/",
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_2darray",
        "return_value": "(False, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Get all the subscription under the database nodes",
      "url": "/browser/subscription/nodes/",
      "is_positive_test": true,
      "mocking_required": false,
      "database_nodes": true,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching all the subscription under the database nodes using wrong database id",
      "url": "/browser/subscription/nodes/",
      "is_positive_test": false,
      "database_nodes": true,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_2darray",
        "return_value": "(False, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 500
      }
    }
  ],
  "delete_subscription": [
    {
      "name": "Delete a subscription URL",
      "url": "/browser/subscription/obj/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while deleting the subscription",
      "url": "/browser/subscription/obj/",
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_scalar",
        "return_value": "(False, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 500
      }
    }
  ],
  "update_subscription": [
    {
      "name": "update a subscription name",
      "url": "/browser/subscription/obj/",
      "is_positive_test": true,
      "update_name": true,
      "test_data": {
        "name": "PLACE_HOLDER",
        "id": "PLACE_HOLDER"
      },
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "update a port in connection details of subscription",
      "url": "/browser/subscription/obj/",
      "is_positive_test": true,
      "test_data": {
        "id": "PLACE_HOLDER",
        "port": "5444"
      },
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "update a username in connection details of subscription",
      "url": "/browser/subscription/obj/",
      "is_positive_test": true,
      "test_data": {
        "id": "PLACE_HOLDER",
        "username": "sample_username"
      },
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching a subscription to update",
      "url": "/browser/subscription/obj/",
      "is_positive_test": false,
      "mocking_required": true,
      "test_data": {
        "name": "PLACE_HOLDER",
        "id": "PLACE_HOLDER"
      },
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Error while fetching a subscription to update using wrong subscription id",
      "url": "/browser/subscription/obj/",
      "is_positive_test": true,
      "wrong_subscription_id": true,
      "mocking_required": false,
      "test_data": {
        "id": "PLACE_HOLDER"
      },
      "mock_data": {},
      "expected_data": {
        "status_code": 500
      }
    }
  ],
  "delete_multiple_subscription": [
    {
      "name": "Delete multiple subscription",
      "url": "/browser/subscription/obj/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    }
  ],
  "sql_subscription": [
    {
      "name": "Fetch the subscription SQL",
      "url": "/browser/subscription/sql/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching a subscription SQL",
      "url": "/browser/subscription/sql/",
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Fetching a subscription mSQL",
      "url": "/browser/subscription/msql/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 200
      }
    }
  ]
}
