{
  "domain_create": [
    {
      "name": "Create domain: With valid data",
      "url": "/browser/domain/obj/",
      "is_positive_test": true,
      "test_data": {
          "basensp": "PLACE HOLDER",
          "basetype": "character",
          "constraints": [{
              "conname": "num",
              "convalidated": true
          }],
          "is_tlength": true,
          "max_val": 2147483647,
          "min_val": 1,
          "name": "domain_add",
          "owner": "PLACE HOLDER",
          "seclabels": [],
          "typdefault": "1",
          "typlen": "10"
      },
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200,
        "error_msg": null,
        "test_result_data": {}
      }
    },
    {"name": "Error while creating a domain - Internal server error",
       "url": "/browser/domain/obj/",
       "is_positive_test": false,
       "internal_server_error": true,
       "test_data": {
         "basensp": "PLACE HOLDER",
         "basetype": "character",
         "constraints": [
           {
             "conname": "num",
             "convalidated": true
           }
         ],
         "is_tlength": true,
         "max_val": 2147483647,
         "min_val": 1,
         "name": "domain_add",
         "owner": "PLACE HOLDER",
         "seclabels": [],
         "typdefault": "1",
         "typlen": "10"
       },
       "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,
         "error_msg": null,
         "test_result_data": {}
       }
     },
    {
       "name": "Error while creating a domain - Internal server error doid",
       "url": "/browser/domain/obj/",
       "is_positive_test": false,
       "error_getting_doid": true,
       "test_data": {
         "basensp": "PLACE HOLDER",
         "basetype": "character",
         "constraints": [
           {
             "conname": "num",
             "convalidated": true
           }
         ],
         "is_tlength": true,
         "max_val": 2147483647,
         "min_val": 1,
         "name": "domain_add",
         "owner": "PLACE HOLDER",
         "seclabels": [],
         "typdefault": "1",
         "typlen": "10"
       },
       "mocking_required": true,
       "mock_data": {
         "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_scalar",
         "return_value": "(True, 'Mocking the scalar output'), (False, 'Mocked Internal Server Error while creating domain')"
       },
       "expected_data": {
         "status_code": 500,
         "error_msg": null,
         "test_result_data": {}
       }
     },
    {
      "name": "Error getting scid while creating a domain - Internal server error",
      "url": "/browser/domain/obj/",
      "is_positive_test": false,
      "error_getting_scid": true,
      "test_data": {
        "basensp": "PLACE HOLDER",
        "basetype": "character",
        "constraints": [
          {
            "conname": "num",
            "convalidated": true
          }
        ],
        "is_tlength": true,
        "max_val": 2147483647,
        "min_val": 1,
        "name": "domain_add",
        "owner": "PLACE HOLDER",
        "seclabels": [],
        "typdefault": "1",
        "typlen": "10"
      },
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_scalar",
        "return_value": "(True, True),(True, True), (False, 'Mocked Internal Server Error while creating domain')"
      },
      "expected_data": {
        "status_code": 500,
        "error_msg": null,
        "test_result_data": {}
      }
    }
  ],
  "domain_delete": [
    {
      "name": "delete domain",
      "url": "/browser/domain/obj/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while deleting a domain - Internal server error - 1",
      "url": "/browser/domain/obj/",
      "error_deleting_domain": true,
      "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 while deleting a domain')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Error while deleting a domain - Internal server error - 2",
      "url": "/browser/domain/obj/",
      "error_deleting_domain": true,
      "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 while deleting a domain')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "delete domain using wrong domain id",
      "url": "/browser/domain/obj/",
      "wrong_domain_id": true,
      "is_positive_test": false,
      "mocking_required": false,
      "mock_data": {
      },
      "expected_data": {
        "status_code": 410
      }
    }
  ],
  "domain_update": [
    {
      "name": "Update domain",
      "url": "/browser/domain/obj/",
      "is_positive_test": true,
      "mocking_required": false,
      "test_data": {
        "description": "This is domain update comment",
        "id": "PLACE_HOLDER"
      },
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while updating a domain",
      "url": "/browser/domain/obj/",
      "error_updating_domain": true,
      "test_data": {
        "description": "This is domain update comment",
        "id": "PLACE_HOLDER"
      },
      "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 while fetching a domain')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Error while updating a domain - Internal server error",
      "url": "/browser/domain/obj/",
      "error_in_db": true,
      "test_data": {
        "description": "This is domain update comment",
        "id": "PLACE_HOLDER"
      },
      "is_positive_test": false,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_scalar",
        "return_value": "[(True, True),(False, 'Mocked Internal Server Error while fetching a domain')]"
      },
      "expected_data": {
        "status_code": 500
      }
    }
  ],
  "domain_get_dependencies_dependants": [
    {
      "name": "Get domain dependents with existing domain id",
      "url": "/browser/domain/dependent/",
      "is_positive_test": true,
      "test_data": {},
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200,
        "error_msg": null,
        "test_result_data": {}
      },
       "is_dependant": true
    },
    {
      "name": "Get domain dependency with existing domain id",
      "url": "/browser/domain/dependency/",
      "is_positive_test": true,
      "test_data": {},
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200,
        "error_msg": null,
        "test_result_data": {}
      },
       "is_dependant": true
    }
  ],
  "domain_get_collations": [
    {
      "name": "Create domain get collations: With valid data.",
      "url": "/browser/domain/get_collations/",
      "is_positive_test": true,
      "inventory_data": {},
      "test_data": {},
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200,
        "error_msg": null,
        "test_result_data": {}
      }
    },
    {
      "name": "Create domain get domain: With valid data while server down.",
      "url": "/browser/domain/get_collations/",
      "is_positive_test": false,
      "inventory_data": {},
      "test_data": {
      },
      "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,
        "error_msg": "Mocked Internal Server Error",
        "test_result_data": {}
      }
    }
  ],
  "domain_get_nodes": [
    {
      "name": "Get domain nodes",
      "url": "/browser/domain/nodes/",
      "is_positive_test": true,
      "test_data": {},
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200,
        "error_msg": null,
        "test_result_data": {}
      }
    },
    {
      "name": "Error while fetching domain nodes",
      "url": "/browser/domain/nodes/",
      "error_fetching_domain": true,
      "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 while fetching a domain nodes')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Get domain node",
      "url": "/browser/domain/nodes/",
      "is_positive_test": true,
      "node": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching a domain node",
      "url": "/browser/domain/nodes/",
      "error_fetching_domain": true,
      "is_positive_test": false,
      "node": true,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_2darray",
        "return_value": "(False, 'Mocked Internal Server Error while fetching a domain nodes')"
      },
      "expected_data": {
        "status_code": 500
      }
    }
  ],
  "domain_multiple_delete" :[
    {
      "name": "Delete multiple domain",
      "url": "/browser/domain/obj/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    }
  ],
  "domain_get": [
    {
      "name": "Get domain",
      "url": "/browser/domain/obj/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching a domain",
      "url": "/browser/domain/obj/",
      "error_fetching_domain": true,
      "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 while fetching a domain')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Get domain list",
      "url": "/browser/domain/obj/",
      "is_positive_test": true,
      "domain_list": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching a domain list",
      "url": "/browser/domain/obj/",
      "error_fetching_domain": true,
      "is_positive_test": false,
      "domain_list": true,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg3.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error while fetching a domain')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Fetch domain using wrong domain id",
      "url": "/browser/domain/obj/",
      "wrong_domain_id": true,
      "is_positive_test": false,
      "mocking_required": false,
      "mock_data": {
      },
      "expected_data": {
        "status_code": 410
      }
    }
  ],
  "domain_get_types": [
     {
       "name": "Domain get types",
       "url": "/browser/domain/get_types/",
       "is_positive_test": true,
       "mocking_required": false,
       "mock_data": {},
       "expected_data": {
         "status_code": 200
       }
     },
     {
       "name": "Domain get types",
       "url": "/browser/domain/get_types/",
       "is_positive_test": false,
       "internal_server_error": true,
       "mocking_required": true,
       "mock_data": {
         "function_name": "pgadmin.browser.server_groups.servers.databases.schemas.domains.DomainView.get_types",
         "return_value": "(False, 'Mocked internal server error')"
       },
       "expected_data": {
         "status_code": 500
       }
     }
   ],
  "domain_get_sql": [
    {
      "name": "Get domain sql - char: With existing domain id.",
      "url": "/browser/domain/sql/",
      "is_positive_test": true,
      "Domain_Reverse_Engineered_SQL_with_char" : true,
      "test_data": {
        "domain_name": "PLACE HOLDER",
        "domain_sql": "PLACE HOLDER"
      },
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200,
        "error_msg": null,
        "test_result_data": {}
      }
    },
    {
      "name": "Get domain sql - length precision: With existing domain id.",
      "url": "/browser/domain/sql/",
      "is_positive_test": true,
      "Domain_Reverse_Engineered_SQL_with_Length_Precision_and_Default" : true,
      "test_data": {
        "domain_name": "PLACE HOLDER",
        "domain_sql": "PLACE HOLDER"
      },
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200,
        "error_msg": null,
        "test_result_data": {}
      }
    },
    {
      "name": "Get domain sql - length: With existing domain id.",
      "url": "/browser/domain/sql/",
      "is_positive_test": true,
      "Domain_Reverse_Engineered_SQL_with_Length" : true,
      "test_data": {
        "domain_name": "PLACE HOLDER",
        "domain_sql": "PLACE HOLDER"
      },
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200,
        "error_msg": null,
        "test_result_data": {}
      }
    },
    {
      "name": "Error while fetching the reverse engineered SQL properties - Internal server error",
      "url": "/browser/domain/sql/",
      "is_positive_test": false,
      "internal_server_error": true,
      "test_data": {
        "domain_name": "PLACE HOLDER",
        "domain_sql": "PLACE HOLDER"
      },
      "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": "Error while fetching the reverse engineered SQL - wrong domain id",
      "url": "/browser/domain/sql/",
      "is_positive_test": false,
      "wrong_domain_id": true,
      "test_data": {
        "domain_name": "PLACE HOLDER",
        "domain_sql": "PLACE HOLDER"
      },
      "mocking_required": true,
      "mock_data": {},
      "expected_data": {
        "status_code": 410
      }
    }
  ],
  "domain_get_msql": [
    {
      "name": "Get domain msql: With existing domain id.",
      "is_positive_test": true,
       "url": "/browser/domain/msql/",
      "test_data": {
        "name": "modifying name",
        "comment": "Comments to test update"
      },
      "mocking_required": true,
      "mock_data": {
         "function_name": "pgadmin.browser.server_groups.servers.databases.schemas.domains.DomainView.get_sql",
         "return_value": "('', 'Mocked get_sql function')"
      },
      "expected_data": {
        "status_code": 200,
        "error_msg": null,
        "test_result_data": {}
      }
    }
  ]
 }


