{
  "fdw_create": [
    {
      "name": "Create fdw: With valid data.",
      "url": "/browser/foreign_data_wrapper/obj/",
      "is_positive_test": true,
      "test_data": {},
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while creating fdw while server down",
      "url": "/browser/foreign_data_wrapper/obj/",
      "is_positive_test": false,
      "error_creating_fdw": true,
      "test_data": {},
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error while creating a foreign data wrapper')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Error while creating fdw - internal server error",
      "url": "/browser/foreign_data_wrapper/obj/",
      "is_positive_test": false,
      "internal_server_error": true,
      "test_data": {},
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_dict",
        "return_value": "(True, True), (False, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Error while creating fdw - invalid data",
      "url": "/browser/foreign_data_wrapper/obj/",
      "is_positive_test": false,
      "invalid_data": true,
      "test_data": {},
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 410
      }
    }
  ],
  "fdw_dependency_dependent": [
    {
      "name": "Get fdw dependency",
      "url": "/browser/foreign_data_wrapper/dependency/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Get fdw dependent",
      "url": "/browser/foreign_data_wrapper/dependent/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    }
  ],
  "fdw_delete": [
    {
      "name": "delete fdw",
      "url": "/browser/foreign_data_wrapper/obj/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while deleting a fdw",
      "url": "/browser/foreign_data_wrapper/obj/",
      "error_deleting_fdw": 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 fdw')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Error while deleting a fdw - internal server error",
      "url": "/browser/foreign_data_wrapper/obj/",
      "internal_server_error": 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 fdw')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "delete fdw using wrong fdw id",
      "url": "/browser/foreign_data_wrapper/obj/",
      "wrong_fdw_id": true,
      "is_positive_test": false,
      "mocking_required": false,
      "mock_data": {
      },
      "expected_data": {
        "status_code": 410
      }
    }
  ],
  "fdw_delete_multiple": [
    {
      "name": "Delete multiple fdw",
      "url": "/browser/foreign_data_wrapper/obj/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    }
  ],
  "fdw_get_nodes_and_node": [
    {
      "name": "Get fdw nodes",
      "url": "/browser/foreign_data_wrapper/nodes/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching fdw nodes",
      "url": "/browser/foreign_data_wrapper/nodes/",
      "error_fetching_fdw": 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 fdw nodes')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Get fdw node",
      "url": "/browser/foreign_data_wrapper/nodes/",
      "is_positive_test": true,
      "node": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching fdw node",
      "url": "/browser/foreign_data_wrapper/nodes/",
      "error_fetching_fdw": 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 fdw nodes')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Fetching fdw node with wrong id",
      "url": "/browser/foreign_data_wrapper/nodes/",
      "wrong_id": true,
      "is_positive_test": false,
      "node": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 410
      }
    }
  ],
  "fdw_get_handlers": [
    {
      "name": "Get get_handlers",
      "url": "/browser/foreign_data_wrapper/get_handlers/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while getting handlers",
      "url": "/browser/foreign_data_wrapper/get_handlers/",
      "internal_server_error": 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 handlers')"
      },
      "expected_data": {
        "status_code": 500
      }
    }
  ],
  "fdw_get_validators": [
    {
      "name": "Get get_validators",
      "url": "/browser/foreign_data_wrapper/get_validators/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while getting validtors",
      "url": "/browser/foreign_data_wrapper/get_validators/",
      "internal_server_error": 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 handlers')"
      },
      "expected_data": {
        "status_code": 500
      }
    }
  ],
  "fdw_update": [
    {
      "name": "Update fdw",
      "url": "/browser/foreign_data_wrapper/obj/",
      "is_positive_test": true,
      "mocking_required": false,
      "test_data": {
        "description": "This is fdw update comment",
        "id": "PLACE_HOLDER"
      },
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while updating a fdw",
      "url": "/browser/foreign_data_wrapper/obj/",
      "internal_server_error": true,
      "test_data": {
        "description": "This is fdw 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 updating fdw')"
      },
      "expected_data": {
        "status_code": 500
      }
    }
  ],
  "fdw_get": [
    {
      "name": "Get fdw",
      "url": "/browser/foreign_data_wrapper/obj/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching a fdw",
      "url": "/browser/foreign_data_wrapper/obj/",
      "error_fetching_fdw": 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 fdw')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Fetch fdw using wrong fdw id",
      "url": "/browser/foreign_data_wrapper/obj/",
      "wrong_fdw_id": true,
      "is_positive_test": false,
      "mocking_required": false,
      "mock_data": {
      },
      "expected_data": {
        "status_code": 410
      }
    },
    {
      "name": "Get fdw list",
      "url": "/browser/foreign_data_wrapper/obj/",
      "is_positive_test": true,
      "fdw_list": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching fdw list",
      "url": "/browser/foreign_data_wrapper/obj/",
      "error_fetching_fdw": true,
      "is_positive_test": false,
      "fdw_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 fdw')"
      },
      "expected_data": {
        "status_code": 500
      }
    }
  ],
  "fdw_get_sql": [
    {
      "name": "Get fdw SQL",
      "url": "/browser/foreign_data_wrapper/sql/",
      "is_positive_test": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 200
      }
    },
    {
      "name": "Error while fetching SQL generated - Internal server error",
      "url": "/browser/foreign_data_wrapper/sql/",
      "is_positive_test": false,
      "internal_server_error": true,
      "mocking_required": true,
      "mock_data": {
        "function_name": "pgadmin.utils.driver.psycopg2.connection.Connection.execute_dict",
        "return_value": "(False, 'Mocked Internal Server Error')"
      },
      "expected_data": {
        "status_code": 500
      }
    },
    {
      "name": "Error while fetching SQL generated - Internal server error",
      "url": "/browser/foreign_data_wrapper/sql/",
      "is_positive_test": false,
      "wrong_fdw_id": true,
      "mocking_required": false,
      "mock_data": {},
      "expected_data": {
        "status_code": 410
      }
    }
  ],
  "fdw_get_msql": [
    {
      "name": "Get fdw msql",
      "is_positive_test": true,
       "url": "/browser/foreign_data_wrapper/msql/",
      "mocking_required": true,
      "mock_data": {
         "function_name": "pgadmin.browser.server_groups.servers.databases.foreign_data_wrappers.ForeignDataWrapperView.get_sql",
         "return_value": "('', 'Mocked get_sql function')"
      },
      "expected_data": {
        "status_code": 200
      }
    }
  ]
}
