diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/__init__.py b/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/__init__.py deleted file mode 100644 index 80f86cb969ec..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/__init__.py +++ /dev/null @@ -1,26 +0,0 @@ -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/__init__.py b/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/__init__.py deleted file mode 100644 index 80f86cb969ec..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/__init__.py +++ /dev/null @@ -1,26 +0,0 @@ -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/__init__.py b/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/__init__.py deleted file mode 100644 index 80f86cb969ec..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/__init__.py +++ /dev/null @@ -1,26 +0,0 @@ -# -------------------------------------------------------------------------- -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/__init__.py b/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/__init__.py index d5e7349fb3ef..af5a389b3d36 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/__init__.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/__init__.py @@ -23,12 +23,13 @@ # IN THE SOFTWARE. # # -------------------------------------------------------------------------- -from ._version import VERSION +from ._version import VERSION # pylint: disable=import-error __version__ = VERSION -from ._schema_registry_avro_encoder import AvroEncoder -from ._message_protocol import MessageType, MessageContent +from ._schema_registry_avro_encoder import AvroEncoder # pylint: disable=import-error +from ._message_protocol import MessageType, MessageContent # pylint: disable=import-error + __all__ = [ "AvroEncoder", diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/_apache_avro_encoder.py b/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/_apache_avro_encoder.py index b972a8ea56de..ed6284b2f856 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/_apache_avro_encoder.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/_apache_avro_encoder.py @@ -9,7 +9,7 @@ import avro from avro.io import DatumWriter, DatumReader, BinaryDecoder, BinaryEncoder -from ._abstract_avro_encoder import AbstractAvroObjectEncoder +from ._abstract_avro_encoder import AbstractAvroObjectEncoder # pylint: disable=import-error ObjectType = TypeVar("ObjectType") diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/_schema_registry_avro_encoder.py b/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/_schema_registry_avro_encoder.py index 01117a783a96..e17d243f427e 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/_schema_registry_avro_encoder.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/_schema_registry_avro_encoder.py @@ -28,14 +28,14 @@ from io import BytesIO from typing import Any, Dict, Mapping, Optional, Union, Callable -from .exceptions import ( +from .exceptions import ( # pylint: disable=import-error SchemaParseError, SchemaEncodeError, SchemaDecodeError, ) -from ._apache_avro_encoder import ApacheAvroObjectEncoder as AvroObjectEncoder -from ._message_protocol import MessageContent, MessageType -from ._constants import ( +from ._apache_avro_encoder import ApacheAvroObjectEncoder as AvroObjectEncoder # pylint: disable=import-error +from ._message_protocol import MessageContent, MessageType # pylint: disable=import-error +from ._constants import ( # pylint: disable=import-error SCHEMA_ID_START_INDEX, SCHEMA_ID_LENGTH, CONTENT_START_INDEX, diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/aio/__init__.py b/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/aio/__init__.py index dfee0c285ae1..84a9db669926 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/aio/__init__.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/aio/__init__.py @@ -23,7 +23,7 @@ # IN THE SOFTWARE. # # -------------------------------------------------------------------------- -from ._schema_registry_avro_encoder_async import AvroEncoder +from ._schema_registry_avro_encoder_async import AvroEncoder # pylint: disable=import-error __all__ = [ "AvroEncoder" diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/aio/_schema_registry_avro_encoder_async.py b/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/aio/_schema_registry_avro_encoder_async.py index 4189d42d1e18..e8fa6902029e 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/aio/_schema_registry_avro_encoder_async.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/aio/_schema_registry_avro_encoder_async.py @@ -26,17 +26,17 @@ import logging from io import BytesIO from typing import Any, Callable, Dict, Mapping, Union, Optional -from ._async_lru import alru_cache -from .._constants import ( +from ._async_lru import alru_cache # pylint: disable=import-error +from .._constants import ( # pylint: disable=import-error SCHEMA_ID_START_INDEX, SCHEMA_ID_LENGTH, CONTENT_START_INDEX, AVRO_MIME_TYPE, RECORD_FORMAT_IDENTIFIER_LENGTH, ) -from .._message_protocol import MessageType, MessageContent -from .._apache_avro_encoder import ApacheAvroObjectEncoder as AvroObjectEncoder -from ..exceptions import ( +from .._message_protocol import MessageType, MessageContent # pylint: disable=import-error +from .._apache_avro_encoder import ApacheAvroObjectEncoder as AvroObjectEncoder # pylint: disable=import-error +from ..exceptions import ( # pylint: disable=import-error SchemaParseError, SchemaEncodeError, SchemaDecodeError, diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/conftest.py b/sdk/schemaregistry/azure-schemaregistry-avroencoder/conftest.py new file mode 100644 index 000000000000..39f72f1f47b4 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/conftest.py @@ -0,0 +1,13 @@ +import pytest +from devtools_testutils import add_general_regex_sanitizer, test_proxy, add_oauth_response_sanitizer + +# autouse=True will trigger this fixture on each pytest run, even if it's not explicitly used by a test method +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + add_general_regex_sanitizer(regex="(?<=\\/\\/)[a-z-]+(?=\\.servicebus\\.windows\\.net)", value="fake_resource") + add_oauth_response_sanitizer() + +# autouse=True will trigger this fixture on each pytest run, even if it's not explicitly used by a test method +@pytest.fixture(scope="session", autouse=True) +def start_proxy(test_proxy): + return diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/setup.py b/sdk/schemaregistry/azure-schemaregistry-avroencoder/setup.py index 5b4b5d7190d3..2abe5d92c338 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/setup.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/setup.py @@ -67,6 +67,9 @@ ], python_requires=">=3.6", zip_safe=False, - packages=find_packages(exclude=exclude_packages), + packages=[ + 'azure.schemaregistry.encoder.avroencoder', + 'azure.schemaregistry.encoder.avroencoder.aio', + ], install_requires=install_packages ) diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_basic_sr_avro_encoder_decode_readers_schema.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_basic_sr_avro_encoder_decode_readers_schema.json new file mode 100644 index 000000000000..9218f0496b0c --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_basic_sr_avro_encoder_decode_readers_schema.json @@ -0,0 +1,286 @@ +{ + "Entries": [ + { + "RequestUri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0/.well-known/openid-configuration", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "1753", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 09 Mar 2022 22:12:41 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xAgAAAFQdu9kOAAAA; expires=Fri, 08-Apr-2022 22:12:41 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12559.5 - WUS2 ProdSlices", + "x-ms-request-id": "02c60093-8ad2-4291-a2e8-a23d5a0e0a00" + }, + "ResponseBody": { + "token_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token", + "token_endpoint_auth_methods_supported": [ + "client_secret_post", + "private_key_jwt", + "client_secret_basic" + ], + "jwks_uri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/discovery/v2.0/keys", + "response_modes_supported": [ + "query", + "fragment", + "form_post" + ], + "subject_types_supported": [ + "pairwise" + ], + "id_token_signing_alg_values_supported": [ + "RS256" + ], + "response_types_supported": [ + "code", + "id_token", + "code id_token", + "id_token token" + ], + "scopes_supported": [ + "openid", + "profile", + "email", + "offline_access" + ], + "issuer": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0", + "request_uri_parameter_supported": false, + "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", + "authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/authorize", + "device_authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/devicecode", + "http_logout_supported": true, + "frontchannel_logout_supported": true, + "end_session_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/logout", + "claims_supported": [ + "sub", + "iss", + "cloud_instance_name", + "cloud_instance_host_name", + "cloud_graph_host_name", + "msgraph_host", + "aud", + "exp", + "iat", + "auth_time", + "acr", + "nonce", + "preferred_username", + "name", + "tid", + "ver", + "at_hash", + "c_hash", + "email" + ], + "kerberos_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/kerberos", + "tenant_region_scope": "WW", + "cloud_instance_name": "microsoftonline.com", + "cloud_graph_host_name": "graph.windows.net", + "msgraph_host": "graph.microsoft.com", + "rbac_url": "https://pas.windows.net" + } + }, + { + "RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Cookie": "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xAgAAAFQdu9kOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "945", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 09 Mar 2022 22:12:41 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xAgAAAFQdu9kOAAAA; expires=Fri, 08-Apr-2022 22:12:41 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12559.4 - WUS2 ProdSlices", + "x-ms-request-id": "e3a1998c-105f-4d55-8383-46b500a61700" + }, + "ResponseBody": { + "tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration", + "api-version": "1.1", + "metadata": [ + { + "preferred_network": "login.microsoftonline.com", + "preferred_cache": "login.windows.net", + "aliases": [ + "login.microsoftonline.com", + "login.windows.net", + "login.microsoft.com", + "sts.windows.net" + ] + }, + { + "preferred_network": "login.partner.microsoftonline.cn", + "preferred_cache": "login.partner.microsoftonline.cn", + "aliases": [ + "login.partner.microsoftonline.cn", + "login.chinacloudapi.cn" + ] + }, + { + "preferred_network": "login.microsoftonline.de", + "preferred_cache": "login.microsoftonline.de", + "aliases": [ + "login.microsoftonline.de" + ] + }, + { + "preferred_network": "login.microsoftonline.us", + "preferred_cache": "login.microsoftonline.us", + "aliases": [ + "login.microsoftonline.us", + "login.usgovcloudapi.net" + ] + }, + { + "preferred_network": "login-us.microsoftonline.com", + "preferred_cache": "login-us.microsoftonline.com", + "aliases": [ + "login-us.microsoftonline.com" + ] + } + ] + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "201", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "0a391aaf-9ff6-11ec-86cf-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:12:42 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "4fda72215677413b8888f87e9db90b87", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "Schema-Name": "example.avro.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "0ae08e62-9ff6-11ec-b673-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; serialization=Avro", + "Date": "Wed, 09 Mar 2022 22:12:42 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "4fda72215677413b8888f87e9db90b87", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "Schema-Name": "example.avro.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked" + }, + "ResponseBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_basic_sr_avro_encoder_with_auto_register_schemas.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_basic_sr_avro_encoder_with_auto_register_schemas.json new file mode 100644 index 000000000000..82c6e343c8d9 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_basic_sr_avro_encoder_with_auto_register_schemas.json @@ -0,0 +1,341 @@ +{ + "Entries": [ + { + "RequestUri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0/.well-known/openid-configuration", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "1753", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 09 Mar 2022 22:12:37 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=Ak4mIDH0nB1Cll0P1J4o7uI; expires=Fri, 08-Apr-2022 22:12:37 GMT; path=/; secure; HttpOnly; SameSite=None", + "esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrS8amZQjy7rbNMbX8M01FFnjsUGZICiV_O8GHCugbABukZMw2AIHPddPHdrqtszuKke-zKo4H-zwPu4XcLJ-HEE_yFBWzQMp90mzEjK0bXhGi9TmWDTf1N2pLOTtJ_Vfota7Xtd8sm7-QzpboooQlj3CRMG8tAPKLV7B4J9oD8hQgAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12559.5 - WUS2 ProdSlices", + "x-ms-request-id": "02c60093-8ad2-4291-a2e8-a23dd80d0a00" + }, + "ResponseBody": { + "token_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token", + "token_endpoint_auth_methods_supported": [ + "client_secret_post", + "private_key_jwt", + "client_secret_basic" + ], + "jwks_uri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/discovery/v2.0/keys", + "response_modes_supported": [ + "query", + "fragment", + "form_post" + ], + "subject_types_supported": [ + "pairwise" + ], + "id_token_signing_alg_values_supported": [ + "RS256" + ], + "response_types_supported": [ + "code", + "id_token", + "code id_token", + "id_token token" + ], + "scopes_supported": [ + "openid", + "profile", + "email", + "offline_access" + ], + "issuer": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0", + "request_uri_parameter_supported": false, + "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", + "authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/authorize", + "device_authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/devicecode", + "http_logout_supported": true, + "frontchannel_logout_supported": true, + "end_session_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/logout", + "claims_supported": [ + "sub", + "iss", + "cloud_instance_name", + "cloud_instance_host_name", + "cloud_graph_host_name", + "msgraph_host", + "aud", + "exp", + "iat", + "auth_time", + "acr", + "nonce", + "preferred_username", + "name", + "tid", + "ver", + "at_hash", + "c_hash", + "email" + ], + "kerberos_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/kerberos", + "tenant_region_scope": "WW", + "cloud_instance_name": "microsoftonline.com", + "cloud_graph_host_name": "graph.windows.net", + "msgraph_host": "graph.microsoft.com", + "rbac_url": "https://pas.windows.net" + } + }, + { + "RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Cookie": "fpc=Ak4mIDH0nB1Cll0P1J4o7uI; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "945", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 09 Mar 2022 22:12:37 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=Ak4mIDH0nB1Cll0P1J4o7uI; expires=Fri, 08-Apr-2022 22:12:37 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12559.4 - WUS2 ProdSlices", + "x-ms-request-id": "8aff4d65-b12e-4c8c-9618-2cf336ce1000" + }, + "ResponseBody": { + "tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration", + "api-version": "1.1", + "metadata": [ + { + "preferred_network": "login.microsoftonline.com", + "preferred_cache": "login.windows.net", + "aliases": [ + "login.microsoftonline.com", + "login.windows.net", + "login.microsoft.com", + "sts.windows.net" + ] + }, + { + "preferred_network": "login.partner.microsoftonline.cn", + "preferred_cache": "login.partner.microsoftonline.cn", + "aliases": [ + "login.partner.microsoftonline.cn", + "login.chinacloudapi.cn" + ] + }, + { + "preferred_network": "login.microsoftonline.de", + "preferred_cache": "login.microsoftonline.de", + "aliases": [ + "login.microsoftonline.de" + ] + }, + { + "preferred_network": "login.microsoftonline.us", + "preferred_cache": "login.microsoftonline.us", + "aliases": [ + "login.microsoftonline.us", + "login.usgovcloudapi.net" + ] + }, + { + "preferred_network": "login-us.microsoftonline.com", + "preferred_cache": "login-us.microsoftonline.com", + "aliases": [ + "login-us.microsoftonline.com" + ] + } + ] + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "201", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "074fd4bb-9ff6-11ec-91b0-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:12:38 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "4fda72215677413b8888f87e9db90b87", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "Schema-Name": "example.avro.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User:get-id?api-version=2021-10", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "221", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "08652efa-9ff6-11ec-9584-9c2976df0bde" + }, + "RequestBody": { + "type": "record", + "name": "User", + "namespace": "example.avro", + "fields": [ + { + "type": "string", + "name": "name" + }, + { + "type": [ + "int", + "null" + ], + "name": "favorite_number" + }, + { + "type": [ + "string", + "null" + ], + "name": "favorite_color" + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:12:38 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "4fda72215677413b8888f87e9db90b87", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "Schema-Name": "example.avro.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "08a638dc-9ff6-11ec-a1a9-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; serialization=Avro", + "Date": "Wed, 09 Mar 2022 22:12:39 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "4fda72215677413b8888f87e9db90b87", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "Schema-Name": "example.avro.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked" + }, + "ResponseBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_basic_sr_avro_encoder_with_request_options.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_basic_sr_avro_encoder_with_request_options.json new file mode 100644 index 000000000000..45957ef98e98 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_basic_sr_avro_encoder_with_request_options.json @@ -0,0 +1,233 @@ +{ + "Entries": [ + { + "RequestUri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0/.well-known/openid-configuration", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "1753", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 09 Mar 2022 22:12:43 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xAgAAAFQdu9kOAAAA; expires=Fri, 08-Apr-2022 22:12:43 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12559.5 - WUS2 ProdSlices", + "x-ms-request-id": "6e43d52d-3d37-4e96-b1ea-98da32c10900" + }, + "ResponseBody": { + "token_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token", + "token_endpoint_auth_methods_supported": [ + "client_secret_post", + "private_key_jwt", + "client_secret_basic" + ], + "jwks_uri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/discovery/v2.0/keys", + "response_modes_supported": [ + "query", + "fragment", + "form_post" + ], + "subject_types_supported": [ + "pairwise" + ], + "id_token_signing_alg_values_supported": [ + "RS256" + ], + "response_types_supported": [ + "code", + "id_token", + "code id_token", + "id_token token" + ], + "scopes_supported": [ + "openid", + "profile", + "email", + "offline_access" + ], + "issuer": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0", + "request_uri_parameter_supported": false, + "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", + "authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/authorize", + "device_authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/devicecode", + "http_logout_supported": true, + "frontchannel_logout_supported": true, + "end_session_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/logout", + "claims_supported": [ + "sub", + "iss", + "cloud_instance_name", + "cloud_instance_host_name", + "cloud_graph_host_name", + "msgraph_host", + "aud", + "exp", + "iat", + "auth_time", + "acr", + "nonce", + "preferred_username", + "name", + "tid", + "ver", + "at_hash", + "c_hash", + "email" + ], + "kerberos_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/kerberos", + "tenant_region_scope": "WW", + "cloud_instance_name": "microsoftonline.com", + "cloud_graph_host_name": "graph.windows.net", + "msgraph_host": "graph.microsoft.com", + "rbac_url": "https://pas.windows.net" + } + }, + { + "RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Cookie": "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xAgAAAFQdu9kOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "945", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 09 Mar 2022 22:12:43 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xAgAAAFQdu9kOAAAA; expires=Fri, 08-Apr-2022 22:12:43 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12529.17 - EUS ProdSlices", + "x-ms-request-id": "37a79fa7-f930-477e-97a1-80a709b87900" + }, + "ResponseBody": { + "tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration", + "api-version": "1.1", + "metadata": [ + { + "preferred_network": "login.microsoftonline.com", + "preferred_cache": "login.windows.net", + "aliases": [ + "login.microsoftonline.com", + "login.windows.net", + "login.microsoft.com", + "sts.windows.net" + ] + }, + { + "preferred_network": "login.partner.microsoftonline.cn", + "preferred_cache": "login.partner.microsoftonline.cn", + "aliases": [ + "login.partner.microsoftonline.cn", + "login.chinacloudapi.cn" + ] + }, + { + "preferred_network": "login.microsoftonline.de", + "preferred_cache": "login.microsoftonline.de", + "aliases": [ + "login.microsoftonline.de" + ] + }, + { + "preferred_network": "login.microsoftonline.us", + "preferred_cache": "login.microsoftonline.us", + "aliases": [ + "login.microsoftonline.us", + "login.usgovcloudapi.net" + ] + }, + { + "preferred_network": "login-us.microsoftonline.com", + "preferred_cache": "login-us.microsoftonline.com", + "aliases": [ + "login-us.microsoftonline.com" + ] + } + ] + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "201", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "0b621629-9ff6-11ec-bf83-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:12:43 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "4fda72215677413b8888f87e9db90b87", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "Schema-Name": "example.avro.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_basic_sr_avro_encoder_without_auto_register_schemas.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_basic_sr_avro_encoder_without_auto_register_schemas.json new file mode 100644 index 000000000000..e262a628efff --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_basic_sr_avro_encoder_without_auto_register_schemas.json @@ -0,0 +1,340 @@ +{ + "Entries": [ + { + "RequestUri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0/.well-known/openid-configuration", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "1753", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 09 Mar 2022 22:12:39 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xAQAAAFQdu9kOAAAA; expires=Fri, 08-Apr-2022 22:12:39 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12559.4 - NCUS ProdSlices", + "x-ms-request-id": "3afa3e2d-92df-470f-8f0e-8e406dd33300" + }, + "ResponseBody": { + "token_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token", + "token_endpoint_auth_methods_supported": [ + "client_secret_post", + "private_key_jwt", + "client_secret_basic" + ], + "jwks_uri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/discovery/v2.0/keys", + "response_modes_supported": [ + "query", + "fragment", + "form_post" + ], + "subject_types_supported": [ + "pairwise" + ], + "id_token_signing_alg_values_supported": [ + "RS256" + ], + "response_types_supported": [ + "code", + "id_token", + "code id_token", + "id_token token" + ], + "scopes_supported": [ + "openid", + "profile", + "email", + "offline_access" + ], + "issuer": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0", + "request_uri_parameter_supported": false, + "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", + "authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/authorize", + "device_authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/devicecode", + "http_logout_supported": true, + "frontchannel_logout_supported": true, + "end_session_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/logout", + "claims_supported": [ + "sub", + "iss", + "cloud_instance_name", + "cloud_instance_host_name", + "cloud_graph_host_name", + "msgraph_host", + "aud", + "exp", + "iat", + "auth_time", + "acr", + "nonce", + "preferred_username", + "name", + "tid", + "ver", + "at_hash", + "c_hash", + "email" + ], + "kerberos_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/kerberos", + "tenant_region_scope": "WW", + "cloud_instance_name": "microsoftonline.com", + "cloud_graph_host_name": "graph.windows.net", + "msgraph_host": "graph.microsoft.com", + "rbac_url": "https://pas.windows.net" + } + }, + { + "RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Cookie": "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xAQAAAFQdu9kOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "945", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 09 Mar 2022 22:12:39 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xAQAAAFQdu9kOAAAA; expires=Fri, 08-Apr-2022 22:12:39 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12559.4 - WUS2 ProdSlices", + "x-ms-request-id": "62b9b046-ba69-4ae1-95b6-5986f6101300" + }, + "ResponseBody": { + "tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration", + "api-version": "1.1", + "metadata": [ + { + "preferred_network": "login.microsoftonline.com", + "preferred_cache": "login.windows.net", + "aliases": [ + "login.microsoftonline.com", + "login.windows.net", + "login.microsoft.com", + "sts.windows.net" + ] + }, + { + "preferred_network": "login.partner.microsoftonline.cn", + "preferred_cache": "login.partner.microsoftonline.cn", + "aliases": [ + "login.partner.microsoftonline.cn", + "login.chinacloudapi.cn" + ] + }, + { + "preferred_network": "login.microsoftonline.de", + "preferred_cache": "login.microsoftonline.de", + "aliases": [ + "login.microsoftonline.de" + ] + }, + { + "preferred_network": "login.microsoftonline.us", + "preferred_cache": "login.microsoftonline.us", + "aliases": [ + "login.microsoftonline.us", + "login.usgovcloudapi.net" + ] + }, + { + "preferred_network": "login-us.microsoftonline.com", + "preferred_cache": "login-us.microsoftonline.com", + "aliases": [ + "login-us.microsoftonline.com" + ] + } + ] + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User:get-id?api-version=2021-10", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "201", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "090ec233-9ff6-11ec-beaf-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:12:40 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "4fda72215677413b8888f87e9db90b87", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "Schema-Name": "example.avro.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User:get-id?api-version=2021-10", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "221", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "099118c1-9ff6-11ec-a60e-9c2976df0bde" + }, + "RequestBody": { + "type": "record", + "name": "User", + "namespace": "example.avro", + "fields": [ + { + "type": "string", + "name": "name" + }, + { + "type": [ + "int", + "null" + ], + "name": "favorite_number" + }, + { + "type": [ + "string", + "null" + ], + "name": "favorite_color" + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:12:40 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "4fda72215677413b8888f87e9db90b87", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "Schema-Name": "example.avro.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "09daed0c-9ff6-11ec-b969-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; serialization=Avro", + "Date": "Wed, 09 Mar 2022 22:12:41 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "4fda72215677413b8888f87e9db90b87", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "Schema-Name": "example.avro.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked" + }, + "ResponseBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_encode_primitive.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_encode_primitive.json new file mode 100644 index 000000000000..0c72cab75a39 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_encode_primitive.json @@ -0,0 +1,211 @@ +{ + "Entries": [ + { + "RequestUri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0/.well-known/openid-configuration", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "1753", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 09 Mar 2022 22:12:48 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xBAAAAFQdu9kOAAAA; expires=Fri, 08-Apr-2022 22:12:48 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12559.4 - SCUS ProdSlices", + "x-ms-request-id": "5dfcb820-9f7e-47ee-a5d0-49a0f5823c00" + }, + "ResponseBody": { + "token_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token", + "token_endpoint_auth_methods_supported": [ + "client_secret_post", + "private_key_jwt", + "client_secret_basic" + ], + "jwks_uri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/discovery/v2.0/keys", + "response_modes_supported": [ + "query", + "fragment", + "form_post" + ], + "subject_types_supported": [ + "pairwise" + ], + "id_token_signing_alg_values_supported": [ + "RS256" + ], + "response_types_supported": [ + "code", + "id_token", + "code id_token", + "id_token token" + ], + "scopes_supported": [ + "openid", + "profile", + "email", + "offline_access" + ], + "issuer": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0", + "request_uri_parameter_supported": false, + "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", + "authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/authorize", + "device_authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/devicecode", + "http_logout_supported": true, + "frontchannel_logout_supported": true, + "end_session_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/logout", + "claims_supported": [ + "sub", + "iss", + "cloud_instance_name", + "cloud_instance_host_name", + "cloud_graph_host_name", + "msgraph_host", + "aud", + "exp", + "iat", + "auth_time", + "acr", + "nonce", + "preferred_username", + "name", + "tid", + "ver", + "at_hash", + "c_hash", + "email" + ], + "kerberos_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/kerberos", + "tenant_region_scope": "WW", + "cloud_instance_name": "microsoftonline.com", + "cloud_graph_host_name": "graph.windows.net", + "msgraph_host": "graph.microsoft.com", + "rbac_url": "https://pas.windows.net" + } + }, + { + "RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Cookie": "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xBAAAAFQdu9kOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "945", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 09 Mar 2022 22:12:48 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xBAAAAFQdu9kOAAAA; expires=Fri, 08-Apr-2022 22:12:48 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12529.17 - WUS2 ProdSlices", + "x-ms-request-id": "64c271e8-306c-4017-b5cb-eeb859b91c01" + }, + "ResponseBody": { + "tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration", + "api-version": "1.1", + "metadata": [ + { + "preferred_network": "login.microsoftonline.com", + "preferred_cache": "login.windows.net", + "aliases": [ + "login.microsoftonline.com", + "login.windows.net", + "login.microsoft.com", + "sts.windows.net" + ] + }, + { + "preferred_network": "login.partner.microsoftonline.cn", + "preferred_cache": "login.partner.microsoftonline.cn", + "aliases": [ + "login.partner.microsoftonline.cn", + "login.chinacloudapi.cn" + ] + }, + { + "preferred_network": "login.microsoftonline.de", + "preferred_cache": "login.microsoftonline.de", + "aliases": [ + "login.microsoftonline.de" + ] + }, + { + "preferred_network": "login.microsoftonline.us", + "preferred_cache": "login.microsoftonline.us", + "aliases": [ + "login.microsoftonline.us", + "login.usgovcloudapi.net" + ] + }, + { + "preferred_network": "login-us.microsoftonline.com", + "preferred_cache": "login-us.microsoftonline.com", + "aliases": [ + "login-us.microsoftonline.com" + ] + } + ] + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/null?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "16", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "0e872f09-9ff6-11ec-aebc-9c2976df0bde" + }, + "RequestBody": { + "type": "null" + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:12:49 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/null/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "a172d38467034fb7861db0bd5018377f", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/a172d38467034fb7861db0bd5018377f?api-version=2021-10", + "Schema-Name": "null", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/null/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_encode_record.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_encode_record.json new file mode 100644 index 000000000000..c62e58a0c3b9 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_encode_record.json @@ -0,0 +1,290 @@ +{ + "Entries": [ + { + "RequestUri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0/.well-known/openid-configuration", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "1753", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 09 Mar 2022 22:12:49 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xBAAAAFQdu9kOAAAA; expires=Fri, 08-Apr-2022 22:12:49 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12559.4 - NCUS ProdSlices", + "x-ms-request-id": "8422f28a-e7ef-4db6-a2d1-ec6024613100" + }, + "ResponseBody": { + "token_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token", + "token_endpoint_auth_methods_supported": [ + "client_secret_post", + "private_key_jwt", + "client_secret_basic" + ], + "jwks_uri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/discovery/v2.0/keys", + "response_modes_supported": [ + "query", + "fragment", + "form_post" + ], + "subject_types_supported": [ + "pairwise" + ], + "id_token_signing_alg_values_supported": [ + "RS256" + ], + "response_types_supported": [ + "code", + "id_token", + "code id_token", + "id_token token" + ], + "scopes_supported": [ + "openid", + "profile", + "email", + "offline_access" + ], + "issuer": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0", + "request_uri_parameter_supported": false, + "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", + "authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/authorize", + "device_authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/devicecode", + "http_logout_supported": true, + "frontchannel_logout_supported": true, + "end_session_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/logout", + "claims_supported": [ + "sub", + "iss", + "cloud_instance_name", + "cloud_instance_host_name", + "cloud_graph_host_name", + "msgraph_host", + "aud", + "exp", + "iat", + "auth_time", + "acr", + "nonce", + "preferred_username", + "name", + "tid", + "ver", + "at_hash", + "c_hash", + "email" + ], + "kerberos_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/kerberos", + "tenant_region_scope": "WW", + "cloud_instance_name": "microsoftonline.com", + "cloud_graph_host_name": "graph.windows.net", + "msgraph_host": "graph.microsoft.com", + "rbac_url": "https://pas.windows.net" + } + }, + { + "RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Cookie": "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xBAAAAFQdu9kOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "945", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 09 Mar 2022 22:12:49 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xBAAAAFQdu9kOAAAA; expires=Fri, 08-Apr-2022 22:12:50 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12559.4 - WUS2 ProdSlices", + "x-ms-request-id": "dd0c434b-39f4-402a-99c7-d9cd440d1900" + }, + "ResponseBody": { + "tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration", + "api-version": "1.1", + "metadata": [ + { + "preferred_network": "login.microsoftonline.com", + "preferred_cache": "login.windows.net", + "aliases": [ + "login.microsoftonline.com", + "login.windows.net", + "login.microsoft.com", + "sts.windows.net" + ] + }, + { + "preferred_network": "login.partner.microsoftonline.cn", + "preferred_cache": "login.partner.microsoftonline.cn", + "aliases": [ + "login.partner.microsoftonline.cn", + "login.chinacloudapi.cn" + ] + }, + { + "preferred_network": "login.microsoftonline.de", + "preferred_cache": "login.microsoftonline.de", + "aliases": [ + "login.microsoftonline.de" + ] + }, + { + "preferred_network": "login.microsoftonline.us", + "preferred_cache": "login.microsoftonline.us", + "aliases": [ + "login.microsoftonline.us", + "login.usgovcloudapi.net" + ] + }, + { + "preferred_network": "login-us.microsoftonline.com", + "preferred_cache": "login-us.microsoftonline.com", + "aliases": [ + "login-us.microsoftonline.com" + ] + } + ] + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.populatedrecord.User?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "405", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "0f303d68-9ff6-11ec-94d9-9c2976df0bde" + }, + "RequestBody": { + "name": "User", + "namespace": "example.avro.populatedrecord", + "type": "record", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "age", + "type": "int" + }, + { + "name": "married", + "type": "boolean" + }, + { + "name": "height", + "type": "float" + }, + { + "name": "randb", + "type": "bytes" + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:12:50 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.populatedrecord.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "de22d689ea144778a7e2dfb0ced43052", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/de22d689ea144778a7e2dfb0ced43052?api-version=2021-10", + "Schema-Name": "example.avro.populatedrecord.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.populatedrecord.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/de22d689ea144778a7e2dfb0ced43052?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "0fd4666d-9ff6-11ec-bbe3-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; serialization=Avro", + "Date": "Wed, 09 Mar 2022 22:12:51 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.populatedrecord.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "de22d689ea144778a7e2dfb0ced43052", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/de22d689ea144778a7e2dfb0ced43052?api-version=2021-10", + "Schema-Name": "example.avro.populatedrecord.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.populatedrecord.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked" + }, + "ResponseBody": { + "name": "User", + "namespace": "example.avro.populatedrecord", + "type": "record", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "age", + "type": "int" + }, + { + "name": "married", + "type": "boolean" + }, + { + "name": "height", + "type": "float" + }, + { + "name": "randb", + "type": "bytes" + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_error_schema_as_record.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_error_schema_as_record.json new file mode 100644 index 000000000000..603a6d6e56aa --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_error_schema_as_record.json @@ -0,0 +1,258 @@ +{ + "Entries": [ + { + "RequestUri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0/.well-known/openid-configuration", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "1753", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 09 Mar 2022 22:12:46 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xAwAAAFQdu9kOAAAA; expires=Fri, 08-Apr-2022 22:12:47 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12559.4 - NCUS ProdSlices", + "x-ms-request-id": "090893a1-44d6-4083-b7e3-cb16bf0f3400" + }, + "ResponseBody": { + "token_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token", + "token_endpoint_auth_methods_supported": [ + "client_secret_post", + "private_key_jwt", + "client_secret_basic" + ], + "jwks_uri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/discovery/v2.0/keys", + "response_modes_supported": [ + "query", + "fragment", + "form_post" + ], + "subject_types_supported": [ + "pairwise" + ], + "id_token_signing_alg_values_supported": [ + "RS256" + ], + "response_types_supported": [ + "code", + "id_token", + "code id_token", + "id_token token" + ], + "scopes_supported": [ + "openid", + "profile", + "email", + "offline_access" + ], + "issuer": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0", + "request_uri_parameter_supported": false, + "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", + "authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/authorize", + "device_authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/devicecode", + "http_logout_supported": true, + "frontchannel_logout_supported": true, + "end_session_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/logout", + "claims_supported": [ + "sub", + "iss", + "cloud_instance_name", + "cloud_instance_host_name", + "cloud_graph_host_name", + "msgraph_host", + "aud", + "exp", + "iat", + "auth_time", + "acr", + "nonce", + "preferred_username", + "name", + "tid", + "ver", + "at_hash", + "c_hash", + "email" + ], + "kerberos_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/kerberos", + "tenant_region_scope": "WW", + "cloud_instance_name": "microsoftonline.com", + "cloud_graph_host_name": "graph.windows.net", + "msgraph_host": "graph.microsoft.com", + "rbac_url": "https://pas.windows.net" + } + }, + { + "RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Cookie": "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xAwAAAFQdu9kOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "945", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 09 Mar 2022 22:12:47 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xAwAAAFQdu9kOAAAA; expires=Fri, 08-Apr-2022 22:12:47 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12529.17 - NCUS ProdSlices", + "x-ms-request-id": "6cc388bb-24e4-438f-8fe5-6c0254380701" + }, + "ResponseBody": { + "tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration", + "api-version": "1.1", + "metadata": [ + { + "preferred_network": "login.microsoftonline.com", + "preferred_cache": "login.windows.net", + "aliases": [ + "login.microsoftonline.com", + "login.windows.net", + "login.microsoft.com", + "sts.windows.net" + ] + }, + { + "preferred_network": "login.partner.microsoftonline.cn", + "preferred_cache": "login.partner.microsoftonline.cn", + "aliases": [ + "login.partner.microsoftonline.cn", + "login.chinacloudapi.cn" + ] + }, + { + "preferred_network": "login.microsoftonline.de", + "preferred_cache": "login.microsoftonline.de", + "aliases": [ + "login.microsoftonline.de" + ] + }, + { + "preferred_network": "login.microsoftonline.us", + "preferred_cache": "login.microsoftonline.us", + "aliases": [ + "login.microsoftonline.us", + "login.usgovcloudapi.net" + ] + }, + { + "preferred_network": "login-us.microsoftonline.com", + "preferred_cache": "login-us.microsoftonline.com", + "aliases": [ + "login-us.microsoftonline.com" + ] + } + ] + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.error.User?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "167", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "0d79753a-9ff6-11ec-9a2e-9c2976df0bde" + }, + "RequestBody": { + "name": "User", + "namespace": "example.avro.error", + "type": "error", + "fields": [ + { + "name": "name", + "type": "string" + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:12:47 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.error.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "963566fa3641418caad58f2abbc6998b", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/963566fa3641418caad58f2abbc6998b?api-version=2021-10", + "Schema-Name": "example.avro.error.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.error.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/963566fa3641418caad58f2abbc6998b?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "0e223370-9ff6-11ec-8be0-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; serialization=Avro", + "Date": "Wed, 09 Mar 2022 22:12:48 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.error.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "963566fa3641418caad58f2abbc6998b", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/963566fa3641418caad58f2abbc6998b?api-version=2021-10", + "Schema-Name": "example.avro.error.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.error.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked" + }, + "ResponseBody": { + "name": "User", + "namespace": "example.avro.error", + "type": "error", + "fields": [ + { + "name": "name", + "type": "string" + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_fixed_types.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_fixed_types.json new file mode 100644 index 000000000000..f721723386d8 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_fixed_types.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_invalid_json_string.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_invalid_json_string.json new file mode 100644 index 000000000000..f721723386d8 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_invalid_json_string.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_invalid_type.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_invalid_type.json new file mode 100644 index 000000000000..f721723386d8 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_invalid_type.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_primitive_types.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_primitive_types.json new file mode 100644 index 000000000000..f721723386d8 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_primitive_types.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_record_fields.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_record_fields.json new file mode 100644 index 000000000000..f721723386d8 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_record_fields.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_record_name.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_record_name.json new file mode 100644 index 000000000000..17b2c1d3c306 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.pyTestAvroEncodertest_parse_record_name.json @@ -0,0 +1,335 @@ +{ + "Entries": [ + { + "RequestUri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0/.well-known/openid-configuration", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "1753", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 09 Mar 2022 22:12:44 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xAgAAAFQdu9kOAAAA; expires=Fri, 08-Apr-2022 22:12:44 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12559.4 - EUS ProdSlices", + "x-ms-request-id": "52f30e79-d0ef-4fed-8a53-41ab50723800" + }, + "ResponseBody": { + "token_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token", + "token_endpoint_auth_methods_supported": [ + "client_secret_post", + "private_key_jwt", + "client_secret_basic" + ], + "jwks_uri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/discovery/v2.0/keys", + "response_modes_supported": [ + "query", + "fragment", + "form_post" + ], + "subject_types_supported": [ + "pairwise" + ], + "id_token_signing_alg_values_supported": [ + "RS256" + ], + "response_types_supported": [ + "code", + "id_token", + "code id_token", + "id_token token" + ], + "scopes_supported": [ + "openid", + "profile", + "email", + "offline_access" + ], + "issuer": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0", + "request_uri_parameter_supported": false, + "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", + "authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/authorize", + "device_authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/devicecode", + "http_logout_supported": true, + "frontchannel_logout_supported": true, + "end_session_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/logout", + "claims_supported": [ + "sub", + "iss", + "cloud_instance_name", + "cloud_instance_host_name", + "cloud_graph_host_name", + "msgraph_host", + "aud", + "exp", + "iat", + "auth_time", + "acr", + "nonce", + "preferred_username", + "name", + "tid", + "ver", + "at_hash", + "c_hash", + "email" + ], + "kerberos_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/kerberos", + "tenant_region_scope": "WW", + "cloud_instance_name": "microsoftonline.com", + "cloud_graph_host_name": "graph.windows.net", + "msgraph_host": "graph.microsoft.com", + "rbac_url": "https://pas.windows.net" + } + }, + { + "RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Cookie": "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xAgAAAFQdu9kOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "945", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 09 Mar 2022 22:12:44 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=Ak4mIDH0nB1Cll0P1J4o7uKlEE-xAgAAAFQdu9kOAAAA; expires=Fri, 08-Apr-2022 22:12:44 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12559.4 - EUS ProdSlices", + "x-ms-request-id": "6e91eb8d-d7b4-429c-ae54-259c55bf5400" + }, + "ResponseBody": { + "tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration", + "api-version": "1.1", + "metadata": [ + { + "preferred_network": "login.microsoftonline.com", + "preferred_cache": "login.windows.net", + "aliases": [ + "login.microsoftonline.com", + "login.windows.net", + "login.microsoft.com", + "sts.windows.net" + ] + }, + { + "preferred_network": "login.partner.microsoftonline.cn", + "preferred_cache": "login.partner.microsoftonline.cn", + "aliases": [ + "login.partner.microsoftonline.cn", + "login.chinacloudapi.cn" + ] + }, + { + "preferred_network": "login.microsoftonline.de", + "preferred_cache": "login.microsoftonline.de", + "aliases": [ + "login.microsoftonline.de" + ] + }, + { + "preferred_network": "login.microsoftonline.us", + "preferred_cache": "login.microsoftonline.us", + "aliases": [ + "login.microsoftonline.us", + "login.usgovcloudapi.net" + ] + }, + { + "preferred_network": "login-us.microsoftonline.com", + "preferred_cache": "login-us.microsoftonline.com", + "aliases": [ + "login-us.microsoftonline.com" + ] + } + ] + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/User.avro?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "166", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "0bf6445a-9ff6-11ec-ad48-9c2976df0bde" + }, + "RequestBody": { + "namespace": "thrownaway", + "name": "User.avro", + "type": "record", + "fields": [ + { + "name": "name", + "type": "string" + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:12:45 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/User.avro/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "ae058aca9cd4409ea7027a89887cd1c0", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/ae058aca9cd4409ea7027a89887cd1c0?api-version=2021-10", + "Schema-Name": "User.avro", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/User.avro/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/ae058aca9cd4409ea7027a89887cd1c0?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "0c90a601-9ff6-11ec-960f-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; serialization=Avro", + "Date": "Wed, 09 Mar 2022 22:12:45 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/User.avro/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "ae058aca9cd4409ea7027a89887cd1c0", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/ae058aca9cd4409ea7027a89887cd1c0?api-version=2021-10", + "Schema-Name": "User.avro", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/User.avro/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked" + }, + "ResponseBody": { + "namespace": "thrownaway", + "name": "User.avro", + "type": "record", + "fields": [ + { + "name": "name", + "type": "string" + } + ] + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/User?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "122", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "0cd6b38b-9ff6-11ec-bd77-9c2976df0bde" + }, + "RequestBody": { + "name": "User", + "type": "record", + "fields": [ + { + "name": "name", + "type": "string" + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:12:46 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "9ef5b880f7254248bad3533afc95d21c", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/9ef5b880f7254248bad3533afc95d21c?api-version=2021-10", + "Schema-Name": "User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/9ef5b880f7254248bad3533afc95d21c?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "0d288ea1-9ff6-11ec-a567-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; serialization=Avro", + "Date": "Wed, 09 Mar 2022 22:12:46 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "9ef5b880f7254248bad3533afc95d21c", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/9ef5b880f7254248bad3533afc95d21c?api-version=2021-10", + "Schema-Name": "User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked" + }, + "ResponseBody": { + "name": "User", + "type": "record", + "fields": [ + { + "name": "name", + "type": "string" + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_basic_sr_avro_encoder_decode_readers_schema.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_basic_sr_avro_encoder_decode_readers_schema.yaml deleted file mode 100644 index 951ab6ce1ee4..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_basic_sr_avro_encoder_decode_readers_schema.yaml +++ /dev/null @@ -1,92 +0,0 @@ -interactions: -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '201' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Thu, 03 Feb 2022 21:27:57 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 648a9a85c4c143e8a4723e820300e5ef - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - schema-name: - - example.avro.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - response: - body: - string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - content-type: - - application/json;serialization=Avro - date: - - Thu, 03 Feb 2022 21:27:57 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 648a9a85c4c143e8a4723e820300e5ef - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - schema-name: - - example.avro.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_basic_sr_avro_encoder_with_auto_register_schemas.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_basic_sr_avro_encoder_with_auto_register_schemas.yaml deleted file mode 100644 index d82e8ad9c8a4..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_basic_sr_avro_encoder_with_auto_register_schemas.yaml +++ /dev/null @@ -1,140 +0,0 @@ -interactions: -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '201' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Thu, 03 Feb 2022 21:27:58 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 648a9a85c4c143e8a4723e820300e5ef - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - schema-name: - - example.avro.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: '{"type": "record", "name": "User", "namespace": "example.avro", "fields": - [{"type": "string", "name": "name"}, {"type": ["int", "null"], "name": "favorite_number"}, - {"type": ["string", "null"], "name": "favorite_color"}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '221' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User:get-id?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Thu, 03 Feb 2022 21:27:58 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 648a9a85c4c143e8a4723e820300e5ef - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - schema-name: - - example.avro.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - response: - body: - string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - content-type: - - application/json;serialization=Avro - date: - - Thu, 03 Feb 2022 21:27:58 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 648a9a85c4c143e8a4723e820300e5ef - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - schema-name: - - example.avro.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_basic_sr_avro_encoder_with_request_options.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_basic_sr_avro_encoder_with_request_options.yaml deleted file mode 100644 index 22ba43041d75..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_basic_sr_avro_encoder_with_request_options.yaml +++ /dev/null @@ -1,48 +0,0 @@ -interactions: -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '201' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Thu, 03 Mar 2022 22:32:53 GMT - location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - bc24cde138814b81b1479d73249d849d - schema-id-location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/$schemas/bc24cde138814b81b1479d73249d849d?api-version=2021-10 - schema-name: - - example.avro.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_basic_sr_avro_encoder_without_auto_register_schemas.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_basic_sr_avro_encoder_without_auto_register_schemas.yaml deleted file mode 100644 index 9d7f65944421..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_basic_sr_avro_encoder_without_auto_register_schemas.yaml +++ /dev/null @@ -1,140 +0,0 @@ -interactions: -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '201' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User:get-id?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Thu, 03 Feb 2022 21:28:00 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 648a9a85c4c143e8a4723e820300e5ef - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - schema-name: - - example.avro.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: '{"type": "record", "name": "User", "namespace": "example.avro", "fields": - [{"type": "string", "name": "name"}, {"type": ["int", "null"], "name": "favorite_number"}, - {"type": ["string", "null"], "name": "favorite_color"}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '221' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User:get-id?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Thu, 03 Feb 2022 21:28:00 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 648a9a85c4c143e8a4723e820300e5ef - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - schema-name: - - example.avro.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - response: - body: - string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - content-type: - - application/json;serialization=Avro - date: - - Thu, 03 Feb 2022 21:28:01 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 648a9a85c4c143e8a4723e820300e5ef - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - schema-name: - - example.avro.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_encode_primitive.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_encode_primitive.yaml deleted file mode 100644 index c07893b7cac4..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_encode_primitive.yaml +++ /dev/null @@ -1,48 +0,0 @@ -interactions: -- request: - body: '{"type": "null"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '16' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/null?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Thu, 03 Feb 2022 21:28:02 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/null/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - bdfae9660e504a13a524d5785901e9a8 - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/bdfae9660e504a13a524d5785901e9a8?api-version=2021-10 - schema-name: - - 'null' - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/null/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_encode_record.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_encode_record.yaml deleted file mode 100644 index bb9c6c707f45..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_encode_record.yaml +++ /dev/null @@ -1,96 +0,0 @@ -interactions: -- request: - body: "{\n \"name\":\"User\",\n \"namespace\":\"example.avro.populatedrecord\",\n - \ \"type\":\"record\",\n \"fields\":[\n {\"name\":\"name\",\"type\":\"string\"},\n - \ {\"name\":\"age\",\"type\":\"int\"},\n {\"name\":\"married\",\"type\":\"boolean\"},\n - \ {\"name\":\"height\",\"type\":\"float\"},\n {\"name\":\"randb\",\"type\":\"bytes\"}\n - \ ]\n }" - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '405' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.populatedrecord.User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Thu, 03 Feb 2022 21:28:04 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.populatedrecord.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 167c05568d1a45bc99cfab05a2a0be37 - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/167c05568d1a45bc99cfab05a2a0be37?api-version=2021-10 - schema-name: - - example.avro.populatedrecord.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.populatedrecord.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/167c05568d1a45bc99cfab05a2a0be37?api-version=2021-10 - response: - body: - string: '{"name":"User","namespace":"example.avro.populatedrecord","type":"record","fields":[{"name":"name","type":"string"},{"name":"age","type":"int"},{"name":"married","type":"boolean"},{"name":"height","type":"float"},{"name":"randb","type":"bytes"}]}' - headers: - content-type: - - application/json;serialization=Avro - date: - - Thu, 03 Feb 2022 21:28:04 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.populatedrecord.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 167c05568d1a45bc99cfab05a2a0be37 - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/167c05568d1a45bc99cfab05a2a0be37?api-version=2021-10 - schema-name: - - example.avro.populatedrecord.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.populatedrecord.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_parse_error_schema_as_record.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_parse_error_schema_as_record.yaml deleted file mode 100644 index b4ff9bf8b138..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_parse_error_schema_as_record.yaml +++ /dev/null @@ -1,94 +0,0 @@ -interactions: -- request: - body: "{\n \"name\":\"User\",\n \"namespace\":\"example.avro.error\",\n - \ \"type\":\"error\",\n \"fields\":[{\"name\":\"name\",\"type\":\"string\"}]\n - \ }" - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '167' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.error.User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Thu, 03 Feb 2022 21:28:05 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.error.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - b161a83a9f1a41fe8d8c07e94bf7cfeb - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/b161a83a9f1a41fe8d8c07e94bf7cfeb?api-version=2021-10 - schema-name: - - example.avro.error.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.error.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/b161a83a9f1a41fe8d8c07e94bf7cfeb?api-version=2021-10 - response: - body: - string: '{"name":"User","namespace":"example.avro.error","type":"error","fields":[{"name":"name","type":"string"}]}' - headers: - content-type: - - application/json;serialization=Avro - date: - - Thu, 03 Feb 2022 21:28:06 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.error.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - b161a83a9f1a41fe8d8c07e94bf7cfeb - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/b161a83a9f1a41fe8d8c07e94bf7cfeb?api-version=2021-10 - schema-name: - - example.avro.error.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.error.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_parse_record_name.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_parse_record_name.yaml deleted file mode 100644 index a4cdfa2917bb..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder.test_parse_record_name.yaml +++ /dev/null @@ -1,185 +0,0 @@ -interactions: -- request: - body: "{\n \"namespace\": \"thrownaway\",\n \"name\":\"User.avro\",\n - \ \"type\":\"record\",\n \"fields\":[{\"name\":\"name\",\"type\":\"string\"}]\n - \ }" - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '166' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/User.avro?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Thu, 03 Feb 2022 21:28:06 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/User.avro/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - ea10fc27c7f34996b6a26a11f08124e4 - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/ea10fc27c7f34996b6a26a11f08124e4?api-version=2021-10 - schema-name: - - User.avro - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/User.avro/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/ea10fc27c7f34996b6a26a11f08124e4?api-version=2021-10 - response: - body: - string: '{"namespace":"thrownaway","name":"User.avro","type":"record","fields":[{"name":"name","type":"string"}]}' - headers: - content-type: - - application/json;serialization=Avro - date: - - Thu, 03 Feb 2022 21:28:08 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/User.avro/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - ea10fc27c7f34996b6a26a11f08124e4 - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/ea10fc27c7f34996b6a26a11f08124e4?api-version=2021-10 - schema-name: - - User.avro - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/User.avro/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 200 - message: OK -- request: - body: "{\n \"name\":\"User\",\n \"type\":\"record\",\n \"fields\":[{\"name\":\"name\",\"type\":\"string\"}]\n - \ }" - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '122' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Thu, 03 Feb 2022 21:28:08 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - de23e62d4e20433bbeac7badad5581a4 - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/de23e62d4e20433bbeac7badad5581a4?api-version=2021-10 - schema-name: - - User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/de23e62d4e20433bbeac7badad5581a4?api-version=2021-10 - response: - body: - string: '{"name":"User","type":"record","fields":[{"name":"name","type":"string"}]}' - headers: - content-type: - - application/json;serialization=Avro - date: - - Thu, 03 Feb 2022 21:28:09 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - de23e62d4e20433bbeac7badad5581a4 - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/de23e62d4e20433bbeac7badad5581a4?api-version=2021-10 - schema-name: - - User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_basic_sr_avro_encoder_decode_readers_schema.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_basic_sr_avro_encoder_decode_readers_schema.json new file mode 100644 index 000000000000..a3ad45c692dd --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_basic_sr_avro_encoder_decode_readers_schema.json @@ -0,0 +1,110 @@ +{ + "Entries": [ + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "201", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "876f0aab-9ff5-11ec-ac6e-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:09:02 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "4fda72215677413b8888f87e9db90b87", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "Schema-Name": "example.avro.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "87c74263-9ff5-11ec-b766-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; serialization=Avro", + "Date": "Wed, 09 Mar 2022 22:09:02 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "4fda72215677413b8888f87e9db90b87", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "Schema-Name": "example.avro.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked" + }, + "ResponseBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_basic_sr_avro_encoder_with_auto_register_schemas.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_basic_sr_avro_encoder_with_auto_register_schemas.json new file mode 100644 index 000000000000..509e8c7230f5 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_basic_sr_avro_encoder_with_auto_register_schemas.json @@ -0,0 +1,163 @@ +{ + "Entries": [ + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "221", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "85096c46-9ff5-11ec-8b4b-9c2976df0bde" + }, + "RequestBody": { + "type": "record", + "name": "User", + "namespace": "example.avro", + "fields": [ + { + "type": "string", + "name": "name" + }, + { + "type": [ + "int", + "null" + ], + "name": "favorite_number" + }, + { + "type": [ + "string", + "null" + ], + "name": "favorite_color" + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:08:58 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "4fda72215677413b8888f87e9db90b87", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "Schema-Name": "example.avro.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User:get-id?api-version=2021-10", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "221", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "85da0ed2-9ff5-11ec-86d0-9c2976df0bde" + }, + "RequestBody": { + "type": "record", + "name": "User", + "namespace": "example.avro", + "fields": [ + { + "type": "string", + "name": "name" + }, + { + "type": [ + "int", + "null" + ], + "name": "favorite_number" + }, + { + "type": [ + "string", + "null" + ], + "name": "favorite_color" + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:08:59 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "4fda72215677413b8888f87e9db90b87", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "Schema-Name": "example.avro.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "8616f16a-9ff5-11ec-8682-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; serialization=Avro", + "Date": "Wed, 09 Mar 2022 22:08:59 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "4fda72215677413b8888f87e9db90b87", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "Schema-Name": "example.avro.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked" + }, + "ResponseBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_basic_sr_avro_encoder_with_request_options.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_basic_sr_avro_encoder_with_request_options.json new file mode 100644 index 000000000000..001014983ba5 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_basic_sr_avro_encoder_with_request_options.json @@ -0,0 +1,58 @@ +{ + "Entries": [ + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "201", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "c52fa859-9ff6-11ec-b6b3-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:17:55 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "4fda72215677413b8888f87e9db90b87", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "Schema-Name": "example.avro.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_basic_sr_avro_encoder_without_auto_register_schemas.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_basic_sr_avro_encoder_without_auto_register_schemas.json new file mode 100644 index 000000000000..ff7b7ca9cb4c --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_basic_sr_avro_encoder_without_auto_register_schemas.json @@ -0,0 +1,163 @@ +{ + "Entries": [ + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "221", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "86890140-9ff5-11ec-a9c2-9c2976df0bde" + }, + "RequestBody": { + "type": "record", + "name": "User", + "namespace": "example.avro", + "fields": [ + { + "type": "string", + "name": "name" + }, + { + "type": [ + "int", + "null" + ], + "name": "favorite_number" + }, + { + "type": [ + "string", + "null" + ], + "name": "favorite_color" + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:09:00 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "4fda72215677413b8888f87e9db90b87", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "Schema-Name": "example.avro.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User:get-id?api-version=2021-10", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "221", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "86e4b85f-9ff5-11ec-835c-9c2976df0bde" + }, + "RequestBody": { + "type": "record", + "name": "User", + "namespace": "example.avro", + "fields": [ + { + "type": "string", + "name": "name" + }, + { + "type": [ + "int", + "null" + ], + "name": "favorite_number" + }, + { + "type": [ + "string", + "null" + ], + "name": "favorite_color" + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:09:00 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "4fda72215677413b8888f87e9db90b87", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "Schema-Name": "example.avro.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "87179733-9ff5-11ec-ac83-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; serialization=Avro", + "Date": "Wed, 09 Mar 2022 22:09:01 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "4fda72215677413b8888f87e9db90b87", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/4fda72215677413b8888f87e9db90b87?api-version=2021-10", + "Schema-Name": "example.avro.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked" + }, + "ResponseBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_encode_primitive.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_encode_primitive.json new file mode 100644 index 000000000000..8ffaedcbd74a --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_encode_primitive.json @@ -0,0 +1,36 @@ +{ + "Entries": [ + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/null?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "16", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "8a90f0f9-9ff5-11ec-bef7-9c2976df0bde" + }, + "RequestBody": { + "type": "null" + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:09:07 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/null/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "a172d38467034fb7861db0bd5018377f", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/a172d38467034fb7861db0bd5018377f?api-version=2021-10", + "Schema-Name": "null", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/null/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_encode_record.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_encode_record.json new file mode 100644 index 000000000000..f8684e55d409 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_encode_record.json @@ -0,0 +1,114 @@ +{ + "Entries": [ + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.populatedrecord.User?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "405", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "8b0dfb95-9ff5-11ec-8cf6-9c2976df0bde" + }, + "RequestBody": { + "name": "User", + "namespace": "example.avro.populatedrecord", + "type": "record", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "age", + "type": "int" + }, + { + "name": "married", + "type": "boolean" + }, + { + "name": "height", + "type": "float" + }, + { + "name": "randb", + "type": "bytes" + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:09:08 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.populatedrecord.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "de22d689ea144778a7e2dfb0ced43052", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/de22d689ea144778a7e2dfb0ced43052?api-version=2021-10", + "Schema-Name": "example.avro.populatedrecord.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.populatedrecord.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/de22d689ea144778a7e2dfb0ced43052?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "8b7e776e-9ff5-11ec-bbc3-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; serialization=Avro", + "Date": "Wed, 09 Mar 2022 22:09:08 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.populatedrecord.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "de22d689ea144778a7e2dfb0ced43052", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/de22d689ea144778a7e2dfb0ced43052?api-version=2021-10", + "Schema-Name": "example.avro.populatedrecord.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.populatedrecord.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked" + }, + "ResponseBody": { + "name": "User", + "namespace": "example.avro.populatedrecord", + "type": "record", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "age", + "type": "int" + }, + { + "name": "married", + "type": "boolean" + }, + { + "name": "height", + "type": "float" + }, + { + "name": "randb", + "type": "bytes" + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_error_schema_as_record.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_error_schema_as_record.json new file mode 100644 index 000000000000..ec2702e585b7 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_error_schema_as_record.json @@ -0,0 +1,82 @@ +{ + "Entries": [ + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.error.User?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "167", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "89a1ff3e-9ff5-11ec-b575-9c2976df0bde" + }, + "RequestBody": { + "name": "User", + "namespace": "example.avro.error", + "type": "error", + "fields": [ + { + "name": "name", + "type": "string" + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:09:05 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.error.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "963566fa3641418caad58f2abbc6998b", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/963566fa3641418caad58f2abbc6998b?api-version=2021-10", + "Schema-Name": "example.avro.error.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.error.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/963566fa3641418caad58f2abbc6998b?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "8a030d32-9ff5-11ec-bc57-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; serialization=Avro", + "Date": "Wed, 09 Mar 2022 22:09:06 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/example.avro.error.User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "963566fa3641418caad58f2abbc6998b", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/963566fa3641418caad58f2abbc6998b?api-version=2021-10", + "Schema-Name": "example.avro.error.User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/example.avro.error.User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked" + }, + "ResponseBody": { + "name": "User", + "namespace": "example.avro.error", + "type": "error", + "fields": [ + { + "name": "name", + "type": "string" + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_fixed_types.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_fixed_types.json new file mode 100644 index 000000000000..f721723386d8 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_fixed_types.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_invalid_json_string.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_invalid_json_string.json new file mode 100644 index 000000000000..f721723386d8 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_invalid_json_string.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_invalid_type.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_invalid_type.json new file mode 100644 index 000000000000..f721723386d8 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_invalid_type.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_primitive_types.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_primitive_types.json new file mode 100644 index 000000000000..f721723386d8 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_primitive_types.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_record_fields.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_record_fields.json new file mode 100644 index 000000000000..f721723386d8 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_record_fields.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_record_name.json b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_record_name.json new file mode 100644 index 000000000000..637d94012bae --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.pyTestAvroEncoderAsynctest_parse_record_name.json @@ -0,0 +1,157 @@ +{ + "Entries": [ + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/User.avro?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "166", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "88514859-9ff5-11ec-8723-9c2976df0bde" + }, + "RequestBody": { + "namespace": "thrownaway", + "name": "User.avro", + "type": "record", + "fields": [ + { + "name": "name", + "type": "string" + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:09:03 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/User.avro/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "ae058aca9cd4409ea7027a89887cd1c0", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/ae058aca9cd4409ea7027a89887cd1c0?api-version=2021-10", + "Schema-Name": "User.avro", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/User.avro/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/ae058aca9cd4409ea7027a89887cd1c0?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "88c60556-9ff5-11ec-bad0-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; serialization=Avro", + "Date": "Wed, 09 Mar 2022 22:09:04 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/User.avro/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "ae058aca9cd4409ea7027a89887cd1c0", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/ae058aca9cd4409ea7027a89887cd1c0?api-version=2021-10", + "Schema-Name": "User.avro", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/User.avro/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked" + }, + "ResponseBody": { + "namespace": "thrownaway", + "name": "User.avro", + "type": "record", + "fields": [ + { + "name": "name", + "type": "string" + } + ] + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/User?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "122", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "88fba584-9ff5-11ec-baf7-9c2976df0bde" + }, + "RequestBody": { + "name": "User", + "type": "record", + "fields": [ + { + "name": "name", + "type": "string" + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 09 Mar 2022 22:09:04 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "9ef5b880f7254248bad3533afc95d21c", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/9ef5b880f7254248bad3533afc95d21c?api-version=2021-10", + "Schema-Name": "User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/9ef5b880f7254248bad3533afc95d21c?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "89538a79-9ff5-11ec-96bb-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; serialization=Avro", + "Date": "Wed, 09 Mar 2022 22:09:04 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/User/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "9ef5b880f7254248bad3533afc95d21c", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/9ef5b880f7254248bad3533afc95d21c?api-version=2021-10", + "Schema-Name": "User", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/User/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked" + }, + "ResponseBody": { + "name": "User", + "type": "record", + "fields": [ + { + "name": "name", + "type": "string" + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_basic_sr_avro_encoder_decode_readers_schema.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_basic_sr_avro_encoder_decode_readers_schema.yaml deleted file mode 100644 index 6bab4e9f3c48..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_basic_sr_avro_encoder_decode_readers_schema.yaml +++ /dev/null @@ -1,63 +0,0 @@ -interactions: -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - Accept: - - application/json - Content-Length: - - '201' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: '0' - date: Thu, 03 Feb 2022 21:28:09 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 648a9a85c4c143e8a4723e820300e5ef - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - schema-name: example.avro.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - status: - code: 204 - message: No Content - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/swathip-test-schema/schemas/example.avro.User?api-version=2021-10 -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - response: - body: - string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - content-type: application/json;serialization=Avro - date: Thu, 03 Feb 2022 21:28:10 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 648a9a85c4c143e8a4723e820300e5ef - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - schema-name: example.avro.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - transfer-encoding: chunked - status: - code: 200 - message: OK - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_basic_sr_avro_encoder_with_auto_register_schemas.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_basic_sr_avro_encoder_with_auto_register_schemas.yaml deleted file mode 100644 index 3b9d1b73fcf7..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_basic_sr_avro_encoder_with_auto_register_schemas.yaml +++ /dev/null @@ -1,99 +0,0 @@ -interactions: -- request: - body: '{"type": "record", "name": "User", "namespace": "example.avro", "fields": - [{"type": "string", "name": "name"}, {"type": ["int", "null"], "name": "favorite_number"}, - {"type": ["string", "null"], "name": "favorite_color"}]}' - headers: - Accept: - - application/json - Content-Length: - - '221' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: '0' - date: Thu, 03 Feb 2022 21:28:11 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 648a9a85c4c143e8a4723e820300e5ef - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - schema-name: example.avro.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - status: - code: 204 - message: No Content - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/swathip-test-schema/schemas/example.avro.User?api-version=2021-10 -- request: - body: '{"type": "record", "name": "User", "namespace": "example.avro", "fields": - [{"type": "string", "name": "name"}, {"type": ["int", "null"], "name": "favorite_number"}, - {"type": ["string", "null"], "name": "favorite_color"}]}' - headers: - Accept: - - application/json - Content-Length: - - '221' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User:get-id?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: '0' - date: Thu, 03 Feb 2022 21:28:11 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 648a9a85c4c143e8a4723e820300e5ef - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - schema-name: example.avro.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - status: - code: 204 - message: No Content - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/swathip-test-schema/schemas/example.avro.User:get-id?api-version=2021-10 -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - response: - body: - string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - content-type: application/json;serialization=Avro - date: Thu, 03 Feb 2022 21:28:12 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 648a9a85c4c143e8a4723e820300e5ef - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - schema-name: example.avro.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - transfer-encoding: chunked - status: - code: 200 - message: OK - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_basic_sr_avro_encoder_without_auto_register_schemas.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_basic_sr_avro_encoder_without_auto_register_schemas.yaml deleted file mode 100644 index da7eea5f67fd..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_basic_sr_avro_encoder_without_auto_register_schemas.yaml +++ /dev/null @@ -1,99 +0,0 @@ -interactions: -- request: - body: '{"type": "record", "name": "User", "namespace": "example.avro", "fields": - [{"type": "string", "name": "name"}, {"type": ["int", "null"], "name": "favorite_number"}, - {"type": ["string", "null"], "name": "favorite_color"}]}' - headers: - Accept: - - application/json - Content-Length: - - '221' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: '0' - date: Thu, 03 Feb 2022 21:28:12 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 648a9a85c4c143e8a4723e820300e5ef - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - schema-name: example.avro.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - status: - code: 204 - message: No Content - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/swathip-test-schema/schemas/example.avro.User?api-version=2021-10 -- request: - body: '{"type": "record", "name": "User", "namespace": "example.avro", "fields": - [{"type": "string", "name": "name"}, {"type": ["int", "null"], "name": "favorite_number"}, - {"type": ["string", "null"], "name": "favorite_color"}]}' - headers: - Accept: - - application/json - Content-Length: - - '221' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User:get-id?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: '0' - date: Thu, 03 Feb 2022 21:28:12 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 648a9a85c4c143e8a4723e820300e5ef - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - schema-name: example.avro.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - status: - code: 204 - message: No Content - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/swathip-test-schema/schemas/example.avro.User:get-id?api-version=2021-10 -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - response: - body: - string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - content-type: application/json;serialization=Avro - date: Thu, 03 Feb 2022 21:28:13 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 648a9a85c4c143e8a4723e820300e5ef - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 - schema-name: example.avro.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - transfer-encoding: chunked - status: - code: 200 - message: OK - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/$schemas/648a9a85c4c143e8a4723e820300e5ef?api-version=2021-10 -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_encode_primitive.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_encode_primitive.yaml deleted file mode 100644 index 43e7093c9540..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_encode_primitive.yaml +++ /dev/null @@ -1,34 +0,0 @@ -interactions: -- request: - body: '{"type": "null"}' - headers: - Accept: - - application/json - Content-Length: - - '16' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/null?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: '0' - date: Thu, 03 Feb 2022 21:28:14 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/null/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: bdfae9660e504a13a524d5785901e9a8 - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/bdfae9660e504a13a524d5785901e9a8?api-version=2021-10 - schema-name: 'null' - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/null/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - status: - code: 204 - message: No Content - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/swathip-test-schema/schemas/null?api-version=2021-10 -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_encode_record.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_encode_record.yaml deleted file mode 100644 index 302b4655ba11..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_encode_record.yaml +++ /dev/null @@ -1,67 +0,0 @@ -interactions: -- request: - body: "{\n \"name\":\"User\",\n \"namespace\":\"example.avro.populatedrecord\",\n - \ \"type\":\"record\",\n \"fields\":[\n {\"name\":\"name\",\"type\":\"string\"},\n - \ {\"name\":\"age\",\"type\":\"int\"},\n {\"name\":\"married\",\"type\":\"boolean\"},\n - \ {\"name\":\"height\",\"type\":\"float\"},\n {\"name\":\"randb\",\"type\":\"bytes\"}\n - \ ]\n }" - headers: - Accept: - - application/json - Content-Length: - - '405' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.populatedrecord.User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: '0' - date: Thu, 03 Feb 2022 21:28:15 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.populatedrecord.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 167c05568d1a45bc99cfab05a2a0be37 - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/167c05568d1a45bc99cfab05a2a0be37?api-version=2021-10 - schema-name: example.avro.populatedrecord.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.populatedrecord.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - status: - code: 204 - message: No Content - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/swathip-test-schema/schemas/example.avro.populatedrecord.User?api-version=2021-10 -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/167c05568d1a45bc99cfab05a2a0be37?api-version=2021-10 - response: - body: - string: '{"name":"User","namespace":"example.avro.populatedrecord","type":"record","fields":[{"name":"name","type":"string"},{"name":"age","type":"int"},{"name":"married","type":"boolean"},{"name":"height","type":"float"},{"name":"randb","type":"bytes"}]}' - headers: - content-type: application/json;serialization=Avro - date: Thu, 03 Feb 2022 21:28:15 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.populatedrecord.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 167c05568d1a45bc99cfab05a2a0be37 - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/167c05568d1a45bc99cfab05a2a0be37?api-version=2021-10 - schema-name: example.avro.populatedrecord.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.populatedrecord.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - transfer-encoding: chunked - status: - code: 200 - message: OK - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/$schemas/167c05568d1a45bc99cfab05a2a0be37?api-version=2021-10 -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_parse_error_schema_as_record.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_parse_error_schema_as_record.yaml deleted file mode 100644 index 53b97dd14b45..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_parse_error_schema_as_record.yaml +++ /dev/null @@ -1,65 +0,0 @@ -interactions: -- request: - body: "{\n \"name\":\"User\",\n \"namespace\":\"example.avro.error\",\n - \ \"type\":\"error\",\n \"fields\":[{\"name\":\"name\",\"type\":\"string\"}]\n - \ }" - headers: - Accept: - - application/json - Content-Length: - - '167' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.error.User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: '0' - date: Thu, 03 Feb 2022 21:28:17 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.error.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: b161a83a9f1a41fe8d8c07e94bf7cfeb - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/b161a83a9f1a41fe8d8c07e94bf7cfeb?api-version=2021-10 - schema-name: example.avro.error.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.error.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - status: - code: 204 - message: No Content - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/swathip-test-schema/schemas/example.avro.error.User?api-version=2021-10 -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/b161a83a9f1a41fe8d8c07e94bf7cfeb?api-version=2021-10 - response: - body: - string: '{"name":"User","namespace":"example.avro.error","type":"error","fields":[{"name":"name","type":"string"}]}' - headers: - content-type: application/json;serialization=Avro - date: Thu, 03 Feb 2022 21:28:17 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.error.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: b161a83a9f1a41fe8d8c07e94bf7cfeb - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/b161a83a9f1a41fe8d8c07e94bf7cfeb?api-version=2021-10 - schema-name: example.avro.error.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.error.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - transfer-encoding: chunked - status: - code: 200 - message: OK - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/$schemas/b161a83a9f1a41fe8d8c07e94bf7cfeb?api-version=2021-10 -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_parse_record_name.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_parse_record_name.yaml deleted file mode 100644 index f8279415b549..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_encoder_async.test_parse_record_name.yaml +++ /dev/null @@ -1,127 +0,0 @@ -interactions: -- request: - body: "{\n \"namespace\": \"thrownaway\",\n \"name\":\"User.avro\",\n - \ \"type\":\"record\",\n \"fields\":[{\"name\":\"name\",\"type\":\"string\"}]\n - \ }" - headers: - Accept: - - application/json - Content-Length: - - '166' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/User.avro?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: '0' - date: Thu, 03 Feb 2022 21:28:18 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/User.avro/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: ea10fc27c7f34996b6a26a11f08124e4 - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/ea10fc27c7f34996b6a26a11f08124e4?api-version=2021-10 - schema-name: User.avro - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/User.avro/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - status: - code: 204 - message: No Content - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/swathip-test-schema/schemas/User.avro?api-version=2021-10 -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/ea10fc27c7f34996b6a26a11f08124e4?api-version=2021-10 - response: - body: - string: '{"namespace":"thrownaway","name":"User.avro","type":"record","fields":[{"name":"name","type":"string"}]}' - headers: - content-type: application/json;serialization=Avro - date: Thu, 03 Feb 2022 21:28:19 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/User.avro/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: ea10fc27c7f34996b6a26a11f08124e4 - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/ea10fc27c7f34996b6a26a11f08124e4?api-version=2021-10 - schema-name: User.avro - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/User.avro/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - transfer-encoding: chunked - status: - code: 200 - message: OK - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/$schemas/ea10fc27c7f34996b6a26a11f08124e4?api-version=2021-10 -- request: - body: "{\n \"name\":\"User\",\n \"type\":\"record\",\n \"fields\":[{\"name\":\"name\",\"type\":\"string\"}]\n - \ }" - headers: - Accept: - - application/json - Content-Length: - - '122' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: '0' - date: Thu, 03 Feb 2022 21:28:19 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: de23e62d4e20433bbeac7badad5581a4 - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/de23e62d4e20433bbeac7badad5581a4?api-version=2021-10 - schema-name: User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - status: - code: 204 - message: No Content - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/swathip-test-schema/schemas/User?api-version=2021-10 -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/de23e62d4e20433bbeac7badad5581a4?api-version=2021-10 - response: - body: - string: '{"name":"User","type":"record","fields":[{"name":"name","type":"string"}]}' - headers: - content-type: application/json;serialization=Avro - date: Thu, 03 Feb 2022 21:28:20 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: de23e62d4e20433bbeac7badad5581a4 - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/de23e62d4e20433bbeac7badad5581a4?api-version=2021-10 - schema-name: User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - transfer-encoding: chunked - status: - code: 200 - message: OK - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/$schemas/de23e62d4e20433bbeac7badad5581a4?api-version=2021-10 -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer.test_basic_sr_avro_serializer_with_auto_register_schemas.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer.test_basic_sr_avro_serializer_with_auto_register_schemas.yaml deleted file mode 100644 index 27e450ae7cd6..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer.test_basic_sr_avro_serializer_with_auto_register_schemas.yaml +++ /dev/null @@ -1,140 +0,0 @@ -interactions: -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '201' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Fri, 05 Nov 2021 23:17:01 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 8bed862d53c8482880a546b063f8f6ef - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/8bed862d53c8482880a546b063f8f6ef?api-version=2021-10 - schema-name: - - example.avro.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: '{"type": "record", "name": "User", "namespace": "example.avro", "fields": - [{"type": "string", "name": "name"}, {"type": ["int", "null"], "name": "favorite_number"}, - {"type": ["string", "null"], "name": "favorite_color"}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '221' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User:get-id?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Fri, 05 Nov 2021 23:17:01 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 8bed862d53c8482880a546b063f8f6ef - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/8bed862d53c8482880a546b063f8f6ef?api-version=2021-10 - schema-name: - - example.avro.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/8bed862d53c8482880a546b063f8f6ef?api-version=2021-10 - response: - body: - string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - content-type: - - application/json;serialization=Avro - date: - - Fri, 05 Nov 2021 23:17:01 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 8bed862d53c8482880a546b063f8f6ef - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/8bed862d53c8482880a546b063f8f6ef?api-version=2021-10 - schema-name: - - example.avro.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer.test_basic_sr_avro_serializer_without_auto_register_schemas.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer.test_basic_sr_avro_serializer_without_auto_register_schemas.yaml deleted file mode 100644 index 43c228cb5301..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer.test_basic_sr_avro_serializer_without_auto_register_schemas.yaml +++ /dev/null @@ -1,140 +0,0 @@ -interactions: -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '201' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User:get-id?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Fri, 05 Nov 2021 23:17:02 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 8bed862d53c8482880a546b063f8f6ef - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/8bed862d53c8482880a546b063f8f6ef?api-version=2021-10 - schema-name: - - example.avro.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: '{"type": "record", "name": "User", "namespace": "example.avro", "fields": - [{"type": "string", "name": "name"}, {"type": ["int", "null"], "name": "favorite_number"}, - {"type": ["string", "null"], "name": "favorite_color"}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '221' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User:get-id?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Fri, 05 Nov 2021 23:17:03 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 8bed862d53c8482880a546b063f8f6ef - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/8bed862d53c8482880a546b063f8f6ef?api-version=2021-10 - schema-name: - - example.avro.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/8bed862d53c8482880a546b063f8f6ef?api-version=2021-10 - response: - body: - string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - content-type: - - application/json;serialization=Avro - date: - - Fri, 05 Nov 2021 23:17:03 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 8bed862d53c8482880a546b063f8f6ef - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/8bed862d53c8482880a546b063f8f6ef?api-version=2021-10 - schema-name: - - example.avro.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer.test_parse_error_schema_as_record.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer.test_parse_error_schema_as_record.yaml deleted file mode 100644 index db54bb0c2f81..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer.test_parse_error_schema_as_record.yaml +++ /dev/null @@ -1,94 +0,0 @@ -interactions: -- request: - body: "{\n \"name\":\"User\",\n \"namespace\":\"example.avro.error\",\n - \ \"type\":\"error\",\n \"fields\":[{\"name\":\"name\",\"type\":\"string\"}]\n - \ }" - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '167' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.error.User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Fri, 05 Nov 2021 23:17:05 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.error.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 126ed9b72e0941ce9ec06ce47051bc63 - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/126ed9b72e0941ce9ec06ce47051bc63?api-version=2021-10 - schema-name: - - example.avro.error.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.error.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/126ed9b72e0941ce9ec06ce47051bc63?api-version=2021-10 - response: - body: - string: '{"name":"User","namespace":"example.avro.error","type":"error","fields":[{"name":"name","type":"string"}]}' - headers: - content-type: - - application/json;serialization=Avro - date: - - Fri, 05 Nov 2021 23:17:05 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.error.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 126ed9b72e0941ce9ec06ce47051bc63 - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/126ed9b72e0941ce9ec06ce47051bc63?api-version=2021-10 - schema-name: - - example.avro.error.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.error.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer.test_parse_record_name.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer.test_parse_record_name.yaml deleted file mode 100644 index 6fd66e14703e..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer.test_parse_record_name.yaml +++ /dev/null @@ -1,185 +0,0 @@ -interactions: -- request: - body: "{\n \"namespace\": \"thrownaway\",\n \"name\":\"User.avro\",\n - \ \"type\":\"record\",\n \"fields\":[{\"name\":\"name\",\"type\":\"string\"}]\n - \ }" - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '166' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/User.avro?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Fri, 05 Nov 2021 23:17:07 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/User.avro/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - c785cfbccd2e43a69e0a95e61506da4c - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/c785cfbccd2e43a69e0a95e61506da4c?api-version=2021-10 - schema-name: - - User.avro - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/User.avro/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/c785cfbccd2e43a69e0a95e61506da4c?api-version=2021-10 - response: - body: - string: '{"namespace":"thrownaway","name":"User.avro","type":"record","fields":[{"name":"name","type":"string"}]}' - headers: - content-type: - - application/json;serialization=Avro - date: - - Fri, 05 Nov 2021 23:17:07 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/User.avro/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - c785cfbccd2e43a69e0a95e61506da4c - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/c785cfbccd2e43a69e0a95e61506da4c?api-version=2021-10 - schema-name: - - User.avro - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/User.avro/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 200 - message: OK -- request: - body: "{\n \"name\":\"User\",\n \"type\":\"record\",\n \"fields\":[{\"name\":\"name\",\"type\":\"string\"}]\n - \ }" - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '122' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Fri, 05 Nov 2021 23:17:08 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 31b0db60056a4d43b880870cf7139c72 - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/31b0db60056a4d43b880870cf7139c72?api-version=2021-10 - schema-name: - - User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/31b0db60056a4d43b880870cf7139c72?api-version=2021-10 - response: - body: - string: '{"name":"User","type":"record","fields":[{"name":"name","type":"string"}]}' - headers: - content-type: - - application/json;serialization=Avro - date: - - Fri, 05 Nov 2021 23:17:08 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 31b0db60056a4d43b880870cf7139c72 - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/31b0db60056a4d43b880870cf7139c72?api-version=2021-10 - schema-name: - - User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer.test_serialize_primitive.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer.test_serialize_primitive.yaml deleted file mode 100644 index 5f149706108c..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer.test_serialize_primitive.yaml +++ /dev/null @@ -1,48 +0,0 @@ -interactions: -- request: - body: '{"type": "null"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '16' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/null?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Fri, 05 Nov 2021 23:17:09 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/null/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - fa716f435d9947039d5eab85735f3fd8 - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/fa716f435d9947039d5eab85735f3fd8?api-version=2021-10 - schema-name: - - 'null' - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/null/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer.test_serialize_record.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer.test_serialize_record.yaml deleted file mode 100644 index d4d59267260b..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer.test_serialize_record.yaml +++ /dev/null @@ -1,96 +0,0 @@ -interactions: -- request: - body: "{\n \"name\":\"User\",\n \"namespace\":\"example.avro.populatedrecord\",\n - \ \"type\":\"record\",\n \"fields\":[\n {\"name\":\"name\",\"type\":\"string\"},\n - \ {\"name\":\"age\",\"type\":\"int\"},\n {\"name\":\"married\",\"type\":\"boolean\"},\n - \ {\"name\":\"height\",\"type\":\"float\"},\n {\"name\":\"randb\",\"type\":\"bytes\"}\n - \ ]\n }" - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '405' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.populatedrecord.User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Fri, 05 Nov 2021 23:17:12 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.populatedrecord.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - e151432d25624815913f3fe5e9e90139 - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/e151432d25624815913f3fe5e9e90139?api-version=2021-10 - schema-name: - - example.avro.populatedrecord.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.populatedrecord.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/e151432d25624815913f3fe5e9e90139?api-version=2021-10 - response: - body: - string: '{"name":"User","namespace":"example.avro.populatedrecord","type":"record","fields":[{"name":"name","type":"string"},{"name":"age","type":"int"},{"name":"married","type":"boolean"},{"name":"height","type":"float"},{"name":"randb","type":"bytes"}]}' - headers: - content-type: - - application/json;serialization=Avro - date: - - Fri, 05 Nov 2021 23:17:13 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.populatedrecord.User/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - e151432d25624815913f3fe5e9e90139 - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/e151432d25624815913f3fe5e9e90139?api-version=2021-10 - schema-name: - - example.avro.populatedrecord.User - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.populatedrecord.User/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer_async.test_basic_sr_avro_serializer_with_auto_register_schemas.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer_async.test_basic_sr_avro_serializer_with_auto_register_schemas.yaml deleted file mode 100644 index a4c3927c75a4..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer_async.test_basic_sr_avro_serializer_with_auto_register_schemas.yaml +++ /dev/null @@ -1,99 +0,0 @@ -interactions: -- request: - body: '{"type": "record", "name": "User", "namespace": "example.avro", "fields": - [{"type": "string", "name": "name"}, {"type": ["int", "null"], "name": "favorite_number"}, - {"type": ["string", "null"], "name": "favorite_color"}]}' - headers: - Accept: - - application/json - Content-Length: - - '221' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: '0' - date: Fri, 05 Nov 2021 23:17:13 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 8bed862d53c8482880a546b063f8f6ef - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/8bed862d53c8482880a546b063f8f6ef?api-version=2021-10 - schema-name: example.avro.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - status: - code: 204 - message: No Content - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/swathip-test-schema/schemas/example.avro.User?api-version=2021-10 -- request: - body: '{"type": "record", "name": "User", "namespace": "example.avro", "fields": - [{"type": "string", "name": "name"}, {"type": ["int", "null"], "name": "favorite_number"}, - {"type": ["string", "null"], "name": "favorite_color"}]}' - headers: - Accept: - - application/json - Content-Length: - - '221' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User:get-id?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: '0' - date: Fri, 05 Nov 2021 23:17:14 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 8bed862d53c8482880a546b063f8f6ef - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/8bed862d53c8482880a546b063f8f6ef?api-version=2021-10 - schema-name: example.avro.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - status: - code: 204 - message: No Content - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/swathip-test-schema/schemas/example.avro.User:get-id?api-version=2021-10 -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/8bed862d53c8482880a546b063f8f6ef?api-version=2021-10 - response: - body: - string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - content-type: application/json;serialization=Avro - date: Fri, 05 Nov 2021 23:17:14 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 8bed862d53c8482880a546b063f8f6ef - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/8bed862d53c8482880a546b063f8f6ef?api-version=2021-10 - schema-name: example.avro.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - transfer-encoding: chunked - status: - code: 200 - message: OK - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/$schemas/8bed862d53c8482880a546b063f8f6ef?api-version=2021-10 -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer_async.test_basic_sr_avro_serializer_without_auto_register_schemas.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer_async.test_basic_sr_avro_serializer_without_auto_register_schemas.yaml deleted file mode 100644 index 8195aed69c20..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer_async.test_basic_sr_avro_serializer_without_auto_register_schemas.yaml +++ /dev/null @@ -1,99 +0,0 @@ -interactions: -- request: - body: '{"type": "record", "name": "User", "namespace": "example.avro", "fields": - [{"type": "string", "name": "name"}, {"type": ["int", "null"], "name": "favorite_number"}, - {"type": ["string", "null"], "name": "favorite_color"}]}' - headers: - Accept: - - application/json - Content-Length: - - '221' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: '0' - date: Fri, 05 Nov 2021 23:17:16 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 8bed862d53c8482880a546b063f8f6ef - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/8bed862d53c8482880a546b063f8f6ef?api-version=2021-10 - schema-name: example.avro.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - status: - code: 204 - message: No Content - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/swathip-test-schema/schemas/example.avro.User?api-version=2021-10 -- request: - body: '{"type": "record", "name": "User", "namespace": "example.avro", "fields": - [{"type": "string", "name": "name"}, {"type": ["int", "null"], "name": "favorite_number"}, - {"type": ["string", "null"], "name": "favorite_color"}]}' - headers: - Accept: - - application/json - Content-Length: - - '221' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.User:get-id?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: '0' - date: Fri, 05 Nov 2021 23:17:17 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 8bed862d53c8482880a546b063f8f6ef - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/8bed862d53c8482880a546b063f8f6ef?api-version=2021-10 - schema-name: example.avro.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - status: - code: 204 - message: No Content - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/swathip-test-schema/schemas/example.avro.User:get-id?api-version=2021-10 -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/8bed862d53c8482880a546b063f8f6ef?api-version=2021-10 - response: - body: - string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - content-type: application/json;serialization=Avro - date: Fri, 05 Nov 2021 23:17:17 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 8bed862d53c8482880a546b063f8f6ef - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/8bed862d53c8482880a546b063f8f6ef?api-version=2021-10 - schema-name: example.avro.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - transfer-encoding: chunked - status: - code: 200 - message: OK - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/$schemas/8bed862d53c8482880a546b063f8f6ef?api-version=2021-10 -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer_async.test_parse_error_schema_as_record.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer_async.test_parse_error_schema_as_record.yaml deleted file mode 100644 index 28f2f6b27e41..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer_async.test_parse_error_schema_as_record.yaml +++ /dev/null @@ -1,65 +0,0 @@ -interactions: -- request: - body: "{\n \"name\":\"User\",\n \"namespace\":\"example.avro.error\",\n - \ \"type\":\"error\",\n \"fields\":[{\"name\":\"name\",\"type\":\"string\"}]\n - \ }" - headers: - Accept: - - application/json - Content-Length: - - '167' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.error.User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: '0' - date: Fri, 05 Nov 2021 23:17:18 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.error.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 126ed9b72e0941ce9ec06ce47051bc63 - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/126ed9b72e0941ce9ec06ce47051bc63?api-version=2021-10 - schema-name: example.avro.error.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.error.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - status: - code: 204 - message: No Content - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/swathip-test-schema/schemas/example.avro.error.User?api-version=2021-10 -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/126ed9b72e0941ce9ec06ce47051bc63?api-version=2021-10 - response: - body: - string: '{"name":"User","namespace":"example.avro.error","type":"error","fields":[{"name":"name","type":"string"}]}' - headers: - content-type: application/json;serialization=Avro - date: Fri, 05 Nov 2021 23:17:19 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.error.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 126ed9b72e0941ce9ec06ce47051bc63 - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/126ed9b72e0941ce9ec06ce47051bc63?api-version=2021-10 - schema-name: example.avro.error.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.error.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - transfer-encoding: chunked - status: - code: 200 - message: OK - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/$schemas/126ed9b72e0941ce9ec06ce47051bc63?api-version=2021-10 -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer_async.test_parse_record_name.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer_async.test_parse_record_name.yaml deleted file mode 100644 index 8474a78fb1ad..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer_async.test_parse_record_name.yaml +++ /dev/null @@ -1,127 +0,0 @@ -interactions: -- request: - body: "{\n \"namespace\": \"thrownaway\",\n \"name\":\"User.avro\",\n - \ \"type\":\"record\",\n \"fields\":[{\"name\":\"name\",\"type\":\"string\"}]\n - \ }" - headers: - Accept: - - application/json - Content-Length: - - '166' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/User.avro?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: '0' - date: Fri, 05 Nov 2021 23:17:19 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/User.avro/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: c785cfbccd2e43a69e0a95e61506da4c - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/c785cfbccd2e43a69e0a95e61506da4c?api-version=2021-10 - schema-name: User.avro - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/User.avro/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - status: - code: 204 - message: No Content - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/swathip-test-schema/schemas/User.avro?api-version=2021-10 -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/c785cfbccd2e43a69e0a95e61506da4c?api-version=2021-10 - response: - body: - string: '{"namespace":"thrownaway","name":"User.avro","type":"record","fields":[{"name":"name","type":"string"}]}' - headers: - content-type: application/json;serialization=Avro - date: Fri, 05 Nov 2021 23:17:20 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/User.avro/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: c785cfbccd2e43a69e0a95e61506da4c - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/c785cfbccd2e43a69e0a95e61506da4c?api-version=2021-10 - schema-name: User.avro - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/User.avro/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - transfer-encoding: chunked - status: - code: 200 - message: OK - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/$schemas/c785cfbccd2e43a69e0a95e61506da4c?api-version=2021-10 -- request: - body: "{\n \"name\":\"User\",\n \"type\":\"record\",\n \"fields\":[{\"name\":\"name\",\"type\":\"string\"}]\n - \ }" - headers: - Accept: - - application/json - Content-Length: - - '122' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: '0' - date: Fri, 05 Nov 2021 23:17:20 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 31b0db60056a4d43b880870cf7139c72 - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/31b0db60056a4d43b880870cf7139c72?api-version=2021-10 - schema-name: User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - status: - code: 204 - message: No Content - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/swathip-test-schema/schemas/User?api-version=2021-10 -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/31b0db60056a4d43b880870cf7139c72?api-version=2021-10 - response: - body: - string: '{"name":"User","type":"record","fields":[{"name":"name","type":"string"}]}' - headers: - content-type: application/json;serialization=Avro - date: Fri, 05 Nov 2021 23:17:21 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: 31b0db60056a4d43b880870cf7139c72 - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/31b0db60056a4d43b880870cf7139c72?api-version=2021-10 - schema-name: User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - transfer-encoding: chunked - status: - code: 200 - message: OK - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/$schemas/31b0db60056a4d43b880870cf7139c72?api-version=2021-10 -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer_async.test_serialize_primitive.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer_async.test_serialize_primitive.yaml deleted file mode 100644 index 66cd2e2c3875..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer_async.test_serialize_primitive.yaml +++ /dev/null @@ -1,34 +0,0 @@ -interactions: -- request: - body: '{"type": "null"}' - headers: - Accept: - - application/json - Content-Length: - - '16' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/null?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: '0' - date: Fri, 05 Nov 2021 23:17:23 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/null/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: fa716f435d9947039d5eab85735f3fd8 - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/fa716f435d9947039d5eab85735f3fd8?api-version=2021-10 - schema-name: 'null' - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/null/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - status: - code: 204 - message: No Content - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/swathip-test-schema/schemas/null?api-version=2021-10 -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer_async.test_serialize_record.yaml b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer_async.test_serialize_record.yaml deleted file mode 100644 index 5474d6fc8054..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/recordings/test_avro_serializer_async.test_serialize_record.yaml +++ /dev/null @@ -1,67 +0,0 @@ -interactions: -- request: - body: "{\n \"name\":\"User\",\n \"namespace\":\"example.avro.populatedrecord\",\n - \ \"type\":\"record\",\n \"fields\":[\n {\"name\":\"name\",\"type\":\"string\"},\n - \ {\"name\":\"age\",\"type\":\"int\"},\n {\"name\":\"married\",\"type\":\"boolean\"},\n - \ {\"name\":\"height\",\"type\":\"float\"},\n {\"name\":\"randb\",\"type\":\"bytes\"}\n - \ ]\n }" - headers: - Accept: - - application/json - Content-Length: - - '405' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/example.avro.populatedrecord.User?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: '0' - date: Fri, 05 Nov 2021 23:17:24 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.populatedrecord.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: e151432d25624815913f3fe5e9e90139 - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/e151432d25624815913f3fe5e9e90139?api-version=2021-10 - schema-name: example.avro.populatedrecord.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.populatedrecord.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - status: - code: 204 - message: No Content - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/swathip-test-schema/schemas/example.avro.populatedrecord.User?api-version=2021-10 -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/e151432d25624815913f3fe5e9e90139?api-version=2021-10 - response: - body: - string: '{"name":"User","namespace":"example.avro.populatedrecord","type":"record","fields":[{"name":"name","type":"string"},{"name":"age","type":"int"},{"name":"married","type":"boolean"},{"name":"height","type":"float"},{"name":"randb","type":"bytes"}]}' - headers: - content-type: application/json;serialization=Avro - date: Fri, 05 Nov 2021 23:17:24 GMT - location: https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/example.avro.populatedrecord.User/versions/1?api-version=2021-10 - schema-group-name: swathip-test-schema - schema-id: e151432d25624815913f3fe5e9e90139 - schema-id-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/e151432d25624815913f3fe5e9e90139?api-version=2021-10 - schema-name: example.avro.populatedrecord.User - schema-version: '1' - schema-versions-location: https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/example.avro.populatedrecord.User/versions?api-version=2021-10 - server: Microsoft-HTTPAPI/2.0 - strict-transport-security: max-age=31536000 - transfer-encoding: chunked - status: - code: 200 - message: OK - url: https://swathip-test-eventhubs.servicebus.windows.net/$schemaGroups/$schemas/e151432d25624815913f3fe5e9e90139?api-version=2021-10 -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/test_avro_encoder.py b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/test_avro_encoder.py index be68d7b78f79..9c39adec285a 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/test_avro_encoder.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/test_avro_encoder.py @@ -30,6 +30,7 @@ from azure.schemaregistry import SchemaRegistryClient from azure.schemaregistry.encoder.avroencoder import AvroEncoder from azure.schemaregistry.encoder.avroencoder.exceptions import SchemaParseError, SchemaEncodeError, SchemaDecodeError +from devtools_testutils import AzureRecordedTestCase, EnvironmentVariableLoader, recorded_by_proxy, AzureTestCase import avro from avro.errors import AvroTypeException @@ -37,9 +38,14 @@ from devtools_testutils import AzureTestCase, PowerShellPreparer -SchemaRegistryPowerShellPreparer = functools.partial(PowerShellPreparer, "schemaregistry", schemaregistry_fully_qualified_namespace="fake_resource.servicebus.windows.net/", schemaregistry_group="fakegroup") +SchemaRegistryEnvironmentVariableLoader = functools.partial(EnvironmentVariableLoader, "schemaregistry", schemaregistry_fully_qualified_namespace="fake_resource.servicebus.windows.net/", schemaregistry_group="fakegroup") -class AvroEncoderTests(AzureTestCase): +class TestAvroEncoder(AzureRecordedTestCase): + + def create_client(self, **kwargs): + fully_qualified_namespace = kwargs.pop("fully_qualified_namespace") + credential = self.get_credential(SchemaRegistryClient) + return self.create_client_from_credential(SchemaRegistryClient, credential, fully_qualified_namespace=fully_qualified_namespace) def test_raw_avro_encoder(self): schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" @@ -79,9 +85,12 @@ def test_raw_avro_encoder_negative(self): with pytest.raises(AvroTypeException): # avro.io.AvroTypeException raw_avro_object_encoder.encode(dict_content_missing_required_field, schema_str) - @SchemaRegistryPowerShellPreparer() - def test_basic_sr_avro_encoder_with_auto_register_schemas(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - sr_client = self.create_basic_client(SchemaRegistryClient, fully_qualified_namespace=schemaregistry_fully_qualified_namespace) + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy + def test_basic_sr_avro_encoder_with_auto_register_schemas(self, **kwargs): + schemaregistry_fully_qualified_namespace = kwargs.pop("schemaregistry_fully_qualified_namespace") + schemaregistry_group = kwargs.pop("schemaregistry_group") + sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" @@ -143,9 +152,12 @@ def good_callback(content: bytes, content_type: str, **kwargs): sr_avro_encoder.close() - @SchemaRegistryPowerShellPreparer() - def test_basic_sr_avro_encoder_without_auto_register_schemas(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - sr_client = self.create_basic_client(SchemaRegistryClient, fully_qualified_namespace=schemaregistry_fully_qualified_namespace) + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy + def test_basic_sr_avro_encoder_without_auto_register_schemas(self, **kwargs): + schemaregistry_fully_qualified_namespace = kwargs.pop("schemaregistry_fully_qualified_namespace") + schemaregistry_group = kwargs.pop("schemaregistry_group") + sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group) schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" @@ -168,9 +180,12 @@ def test_basic_sr_avro_encoder_without_auto_register_schemas(self, schemaregistr sr_avro_encoder.close() - @SchemaRegistryPowerShellPreparer() - def test_basic_sr_avro_encoder_decode_readers_schema(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - sr_client = self.create_basic_client(SchemaRegistryClient, fully_qualified_namespace=schemaregistry_fully_qualified_namespace) + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy + def test_basic_sr_avro_encoder_decode_readers_schema(self, **kwargs): + schemaregistry_fully_qualified_namespace = kwargs.pop("schemaregistry_fully_qualified_namespace") + sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) + schemaregistry_group = kwargs.pop("schemaregistry_group") sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" @@ -200,9 +215,12 @@ def test_basic_sr_avro_encoder_decode_readers_schema(self, schemaregistry_fully_ with pytest.raises(SchemaDecodeError): decoded_content = sr_avro_encoder.decode(encoded_content_dict, readers_schema=readers_schema_change_name) - @SchemaRegistryPowerShellPreparer() - def test_basic_sr_avro_encoder_with_request_options(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - sr_client = self.create_basic_client(SchemaRegistryClient, fully_qualified_namespace=schemaregistry_fully_qualified_namespace) + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy + def test_basic_sr_avro_encoder_with_request_options(self, **kwargs): + schemaregistry_fully_qualified_namespace = kwargs.pop("schemaregistry_fully_qualified_namespace") + schemaregistry_group = kwargs.pop("schemaregistry_group") + sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" @@ -225,9 +243,12 @@ def test_basic_sr_avro_encoder_with_request_options(self, schemaregistry_fully_q ######################### PARSE SCHEMAS ######################### ################################################################# - @SchemaRegistryPowerShellPreparer() - def test_parse_invalid_json_string(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - sr_client = self.create_basic_client(SchemaRegistryClient, fully_qualified_namespace=schemaregistry_fully_qualified_namespace) + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy + def test_parse_invalid_json_string(self, **kwargs): + schemaregistry_fully_qualified_namespace = kwargs.pop("schemaregistry_fully_qualified_namespace") + schemaregistry_group = kwargs.pop("schemaregistry_group") + sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) invalid_schema = { "name":"User", @@ -241,9 +262,12 @@ def test_parse_invalid_json_string(self, schemaregistry_fully_qualified_namespac ######################### PRIMITIVES ######################### - @SchemaRegistryPowerShellPreparer() - def test_parse_primitive_types(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - sr_client = self.create_basic_client(SchemaRegistryClient, fully_qualified_namespace=schemaregistry_fully_qualified_namespace) + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy + def test_parse_primitive_types(self, **kwargs): + schemaregistry_fully_qualified_namespace = kwargs.pop("schemaregistry_fully_qualified_namespace") + schemaregistry_group = kwargs.pop("schemaregistry_group") + sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) primitive_string = "string" @@ -252,9 +276,12 @@ def test_parse_primitive_types(self, schemaregistry_fully_qualified_namespace, s ######################### type fixed ######################### - @SchemaRegistryPowerShellPreparer() - def test_parse_fixed_types(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - sr_client = self.create_basic_client(SchemaRegistryClient, fully_qualified_namespace=schemaregistry_fully_qualified_namespace) + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy + def test_parse_fixed_types(self, **kwargs): + schemaregistry_fully_qualified_namespace = kwargs.pop("schemaregistry_fully_qualified_namespace") + schemaregistry_group = kwargs.pop("schemaregistry_group") + sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) # avro bug: should give warning from IgnoredLogicalType error since precision < 0 @@ -279,9 +306,12 @@ def test_parse_fixed_types(self, schemaregistry_fully_qualified_namespace, schem ######################### type unspecified ######################### - @SchemaRegistryPowerShellPreparer() - def test_parse_invalid_type(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - sr_client = self.create_basic_client(SchemaRegistryClient, fully_qualified_namespace=schemaregistry_fully_qualified_namespace) + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy + def test_parse_invalid_type(self, **kwargs): + schemaregistry_fully_qualified_namespace = kwargs.pop("schemaregistry_fully_qualified_namespace") + schemaregistry_group = kwargs.pop("schemaregistry_group") + sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) schema_no_type = """{ @@ -303,9 +333,12 @@ def test_parse_invalid_type(self, schemaregistry_fully_qualified_namespace, sche ######################### RECORD SCHEMA ######################### - @SchemaRegistryPowerShellPreparer() - def test_parse_record_name(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - sr_client = self.create_basic_client(SchemaRegistryClient, fully_qualified_namespace=schemaregistry_fully_qualified_namespace) + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy + def test_parse_record_name(self, **kwargs): + schemaregistry_fully_qualified_namespace = kwargs.pop("schemaregistry_fully_qualified_namespace") + schemaregistry_group = kwargs.pop("schemaregistry_group") + sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) schema_name_has_dot = """{ @@ -378,9 +411,12 @@ def test_parse_record_name(self, schemaregistry_fully_qualified_namespace, schem with pytest.raises(SchemaParseError): sr_avro_encoder.encode({"name": u"Ben"}, schema=schema_no_name) - @SchemaRegistryPowerShellPreparer() - def test_parse_error_schema_as_record(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - sr_client = self.create_basic_client(SchemaRegistryClient, fully_qualified_namespace=schemaregistry_fully_qualified_namespace) + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy + def test_parse_error_schema_as_record(self, **kwargs): + schemaregistry_fully_qualified_namespace = kwargs.pop("schemaregistry_fully_qualified_namespace") + schemaregistry_group = kwargs.pop("schemaregistry_group") + sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) schema_error_type = """{ @@ -395,9 +431,12 @@ def test_parse_error_schema_as_record(self, schemaregistry_fully_qualified_names decoded_registered_schema = json.loads(registered_schema.definition) assert decoded_registered_schema["type"] == "error" - @SchemaRegistryPowerShellPreparer() - def test_parse_record_fields(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - sr_client = self.create_basic_client(SchemaRegistryClient, fully_qualified_namespace=schemaregistry_fully_qualified_namespace) + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy + def test_parse_record_fields(self, **kwargs): + schemaregistry_fully_qualified_namespace = kwargs.pop("schemaregistry_fully_qualified_namespace") + schemaregistry_group = kwargs.pop("schemaregistry_group") + sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) schema_no_fields = """{ @@ -475,18 +514,24 @@ def test_parse_record_fields(self, schemaregistry_fully_qualified_namespace, sch #################### SERIALIZE AND DESERIALIZE ################## ################################################################# - @SchemaRegistryPowerShellPreparer() - def test_encode_primitive(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - sr_client = self.create_basic_client(SchemaRegistryClient, fully_qualified_namespace=schemaregistry_fully_qualified_namespace) + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy + def test_encode_primitive(self, **kwargs): + schemaregistry_fully_qualified_namespace = kwargs.pop("schemaregistry_fully_qualified_namespace") + schemaregistry_group = kwargs.pop("schemaregistry_group") + sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) null_type = """{"type": "null"}""" encoded_message_content = sr_avro_encoder.encode(None, schema=null_type) assert len(encoded_message_content["content"]) == 0 # assert no content encoded - @SchemaRegistryPowerShellPreparer() - def test_encode_record(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - sr_client = self.create_basic_client(SchemaRegistryClient, fully_qualified_namespace=schemaregistry_fully_qualified_namespace) + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy + def test_encode_record(self, **kwargs): + schemaregistry_fully_qualified_namespace = kwargs.pop("schemaregistry_fully_qualified_namespace") + schemaregistry_group = kwargs.pop("schemaregistry_group") + sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) # add below to schema fields later if needed diff --git a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/test_avro_encoder_async.py b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/test_avro_encoder_async.py index 627703de0d92..0151ff441e12 100644 --- a/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/test_avro_encoder_async.py +++ b/sdk/schemaregistry/azure-schemaregistry-avroencoder/tests/test_avro_encoder_async.py @@ -38,20 +38,23 @@ from azure.schemaregistry.encoder.avroencoder.aio import AvroEncoder from azure.schemaregistry.encoder.avroencoder.exceptions import SchemaParseError, SchemaEncodeError, SchemaDecodeError -from devtools_testutils import AzureTestCase, PowerShellPreparer +from devtools_testutils import AzureRecordedTestCase, EnvironmentVariableLoader +from devtools_testutils.aio import recorded_by_proxy_async -SchemaRegistryPowerShellPreparer = functools.partial(PowerShellPreparer, "schemaregistry", schemaregistry_fully_qualified_namespace="fake_resource.servicebus.windows.net/", schemaregistry_group="fakegroup") +SchemaRegistryEnvironmentVariableLoader = functools.partial(EnvironmentVariableLoader, "schemaregistry", schemaregistry_fully_qualified_namespace="fake_resource.servicebus.windows.net/", schemaregistry_group="fakegroup") -class AvroEncoderAsyncTests(AzureTestCase): +class TestAvroEncoderAsync(AzureRecordedTestCase): - def create_client(self, fully_qualified_namespace): + def create_client(self, **kwargs): + fully_qualified_namespace = kwargs.pop("fully_qualified_namespace") credential = self.get_credential(SchemaRegistryClient, is_async=True) return self.create_client_from_credential(SchemaRegistryClient, credential, fully_qualified_namespace=fully_qualified_namespace, is_async=True) @pytest.mark.asyncio - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_basic_sr_avro_encoder_with_auto_register_schemas(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - sr_client = self.create_client(schemaregistry_fully_qualified_namespace) + sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) async with sr_client: @@ -115,9 +118,10 @@ def good_callback(content: bytes, content_type: str, **kwargs): assert decoded_content_callback["favorite_color"] == u"red" @pytest.mark.asyncio - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_basic_sr_avro_encoder_without_auto_register_schemas(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - sr_client = self.create_client(schemaregistry_fully_qualified_namespace) + sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) async with sr_client: @@ -142,9 +146,10 @@ async def test_basic_sr_avro_encoder_without_auto_register_schemas(self, schemar assert decoded_content["favorite_color"] == u"red" @pytest.mark.asyncio - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_basic_sr_avro_encoder_decode_readers_schema(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - sr_client = self.create_client(schemaregistry_fully_qualified_namespace) + sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" @@ -177,12 +182,35 @@ async def test_basic_sr_avro_encoder_decode_readers_schema(self, schemaregistry_ decoded_content = await sr_avro_encoder.decode(encoded_content_dict, readers_schema=readers_schema_change_name) print(decoded_content) + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async + async def test_basic_sr_avro_encoder_with_request_options(self, **kwargs): + schemaregistry_fully_qualified_namespace = kwargs.pop("schemaregistry_fully_qualified_namespace") + schemaregistry_group = kwargs.pop("schemaregistry_group") + sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) + sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) + + schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" + + dict_content = {"name": u"Ben", "favorite_number": 7, "favorite_color": u"red"} + with pytest.raises(TypeError) as e: + encoded_message_content = await sr_avro_encoder.encode(dict_content, schema=schema_str, request_options={"fake_kwarg": True}) + assert 'request() got an unexpected keyword' in str(e.value) + encoded_message_content = await sr_avro_encoder.encode(dict_content, schema=schema_str) + content_type = encoded_message_content["content_type"] + encoded_content = encoded_message_content["content"] + + encoded_content_dict = {"content": encoded_content, "content_type": content_type} + with pytest.raises(TypeError) as e: + decoded_content = await sr_avro_encoder.decode(encoded_content_dict, request_options={"fake_kwarg": True}) + assert 'request() got an unexpected keyword' in str(e.value) ################################################################# ######################### PARSE SCHEMAS ######################### ################################################################# - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_parse_invalid_json_string(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) @@ -198,7 +226,8 @@ async def test_parse_invalid_json_string(self, schemaregistry_fully_qualified_na ######################### PRIMITIVES ######################### - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_parse_primitive_types(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) @@ -209,7 +238,8 @@ async def test_parse_primitive_types(self, schemaregistry_fully_qualified_namesp ######################### type fixed ######################### - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_parse_fixed_types(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) @@ -236,7 +266,8 @@ async def test_parse_fixed_types(self, schemaregistry_fully_qualified_namespace, ######################### type unspecified ######################### - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_parse_invalid_type(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) @@ -260,7 +291,8 @@ async def test_parse_invalid_type(self, schemaregistry_fully_qualified_namespace ######################### RECORD SCHEMA ######################### - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_parse_record_name(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) @@ -334,7 +366,8 @@ async def test_parse_record_name(self, schemaregistry_fully_qualified_namespace, with pytest.raises(SchemaParseError): await sr_avro_encoder.encode({"name": u"Ben"}, schema=schema_no_name) - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_parse_error_schema_as_record(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) @@ -351,7 +384,8 @@ async def test_parse_error_schema_as_record(self, schemaregistry_fully_qualified decoded_registered_schema = json.loads(registered_schema.definition) assert decoded_registered_schema["type"] == "error" - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_parse_record_fields(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) @@ -431,7 +465,8 @@ async def test_parse_record_fields(self, schemaregistry_fully_qualified_namespac #################### ENCODE AND DECODE ########################## ################################################################# - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_encode_primitive(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) @@ -440,7 +475,8 @@ async def test_encode_primitive(self, schemaregistry_fully_qualified_namespace, encoded_message_content = await sr_avro_encoder.encode(None, schema=null_type) assert len(encoded_message_content["content"]) == 0 # assert no content encoded - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_encode_record(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): sr_client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) sr_avro_encoder = AvroEncoder(client=sr_client, group_name=schemaregistry_group, auto_register_schemas=True) diff --git a/sdk/schemaregistry/azure-schemaregistry/conftest.py b/sdk/schemaregistry/azure-schemaregistry/conftest.py new file mode 100644 index 000000000000..39f72f1f47b4 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry/conftest.py @@ -0,0 +1,13 @@ +import pytest +from devtools_testutils import add_general_regex_sanitizer, test_proxy, add_oauth_response_sanitizer + +# autouse=True will trigger this fixture on each pytest run, even if it's not explicitly used by a test method +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + add_general_regex_sanitizer(regex="(?<=\\/\\/)[a-z-]+(?=\\.servicebus\\.windows\\.net)", value="fake_resource") + add_oauth_response_sanitizer() + +# autouse=True will trigger this fixture on each pytest run, even if it's not explicitly used by a test method +@pytest.fixture(scope="session", autouse=True) +def start_proxy(test_proxy): + return diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/test_schema_registry_async.py b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/test_schema_registry_async.py index 87031b22bbac..43c47b0a65d4 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/test_schema_registry_async.py +++ b/sdk/schemaregistry/azure-schemaregistry/tests/async_tests/test_schema_registry_async.py @@ -26,23 +26,25 @@ from azure.identity.aio import ClientSecretCredential from azure.core.exceptions import ClientAuthenticationError, ServiceRequestError, HttpResponseError -from schemaregistry_preparer import SchemaRegistryPreparer -from devtools_testutils import AzureTestCase, PowerShellPreparer +from devtools_testutils import AzureRecordedTestCase, EnvironmentVariableLoader +from devtools_testutils.aio import recorded_by_proxy_async from devtools_testutils.azure_testcase import _is_autorest_v3 from azure.core.credentials import AccessToken -SchemaRegistryPowerShellPreparer = functools.partial(PowerShellPreparer, "schemaregistry", schemaregistry_fully_qualified_namespace="fake_resource.servicebus.windows.net/", schemaregistry_group="fakegroup") +SchemaRegistryEnvironmentVariableLoader = functools.partial(EnvironmentVariableLoader, "schemaregistry", schemaregistry_fully_qualified_namespace="fake_resource.servicebus.windows.net/", schemaregistry_group="fakegroup") -class SchemaRegistryAsyncTests(AzureTestCase): +class TestSchemaRegistryAsync(AzureRecordedTestCase): - def create_client(self, fully_qualified_namespace): + def create_client(self, **kwargs): + fully_qualified_namespace = kwargs.pop("fully_qualified_namespace") credential = self.get_credential(SchemaRegistryClient, is_async=True) return self.create_client_from_credential(SchemaRegistryClient, credential, fully_qualified_namespace=fully_qualified_namespace, is_async=True) - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_schema_basic_async(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - client = self.create_client(schemaregistry_fully_qualified_namespace) + client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) async with client: name = self.get_resource_name('test-schema-basic-async') schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" @@ -64,9 +66,10 @@ async def test_schema_basic_async(self, schemaregistry_fully_qualified_namespace assert returned_schema_properties.format == "Avro" await client._generated_client._config.credential.close() - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_schema_update_async(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - client = self.create_client(schemaregistry_fully_qualified_namespace) + client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) async with client: name = self.get_resource_name('test-schema-update-async') schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" @@ -91,9 +94,10 @@ async def test_schema_update_async(self, schemaregistry_fully_qualified_namespac await client._generated_client._config.credential.close() - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_schema_same_twice_async(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - client = self.create_client(schemaregistry_fully_qualified_namespace) + client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) name = self.get_resource_name('test-schema-twice-async') schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}""" format = "Avro" @@ -103,7 +107,8 @@ async def test_schema_same_twice_async(self, schemaregistry_fully_qualified_name assert schema_properties.id == schema_properties_second.id await client._generated_client._config.credential.close() - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_schema_negative_wrong_credential_async(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): credential = ClientSecretCredential(tenant_id="fake", client_id="fake", client_secret="fake") client = SchemaRegistryClient(fully_qualified_namespace=schemaregistry_fully_qualified_namespace, credential=credential) @@ -114,9 +119,11 @@ async def test_schema_negative_wrong_credential_async(self, schemaregistry_fully with pytest.raises(ClientAuthenticationError): await client.register_schema(schemaregistry_group, name, schema_str, format) - @SchemaRegistryPowerShellPreparer() + @pytest.mark.skip('test proxy/CI gives HttpResponseError, live test pipeline gives ServiceRequestError') + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_schema_negative_wrong_endpoint_async(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - client = self.create_client("nonexist.servicebus.windows.net") + client = self.create_client(fully_qualified_namespace="nonexist.servicebus.windows.net") async with client: name = self.get_resource_name('test-schema-nonexist-async') schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" @@ -125,9 +132,10 @@ async def test_schema_negative_wrong_endpoint_async(self, schemaregistry_fully_q await client.register_schema(schemaregistry_group, name, schema_str, format) await client._generated_client._config.credential.close() - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_schema_negative_no_schema_async(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - client = self.create_client(schemaregistry_fully_qualified_namespace) + client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) async with client: with pytest.raises(HttpResponseError): await client.get_schema('a') @@ -136,9 +144,10 @@ async def test_schema_negative_no_schema_async(self, schemaregistry_fully_qualif await client.get_schema('a' * 32) await client._generated_client._config.credential.close() - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_register_schema_errors(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - client = self.create_client(schemaregistry_fully_qualified_namespace) + client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) name = 'test-schema' schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}""" format = "Avro" @@ -165,9 +174,10 @@ async def test_register_schema_errors(self, schemaregistry_fully_qualified_names assert e.value.status_code == 415 assert e.value.reason == 'Unsupported Media Type' - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_get_schema_properties_errors(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - client = self.create_client(schemaregistry_fully_qualified_namespace) + client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) name = 'test-schema' schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}""" format = "Avro" @@ -200,9 +210,10 @@ async def test_get_schema_properties_errors(self, schemaregistry_fully_qualified assert e.value.status_code == 404 assert e.value.reason == 'Not Found' - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy_async async def test_get_schema_errors(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - client = self.create_client(schemaregistry_fully_qualified_namespace) + client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) async with client: with pytest.raises(ValueError) as e: await client.get_schema(None) diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_get_schema_errors.json b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_get_schema_errors.json new file mode 100644 index 000000000000..47c4d0075bb2 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_get_schema_errors.json @@ -0,0 +1,32 @@ +{ + "Entries": [ + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/fakeschemaid?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "315adcf5-a159-11ec-9d91-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Fri, 11 Mar 2022 16:34:58 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked", + "x-ms-error-code": "InvalidRequest" + }, + "ResponseBody": { + "error": { + "code": "InvalidRequest", + "message": "SubCode=40000, UnknownType:The request is invalid. [MGResponseHttpError=BadRequest]. TrackingId:68e0972f-83c2-4295-9d57-5b0058b6ebc8_G1, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups/$schemas/fakeschemaid, Timestamp:2022-03-11T16:34:59" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_get_schema_properties_errors.json b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_get_schema_properties_errors.json new file mode 100644 index 000000000000..a5b39e6911cc --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_get_schema_properties_errors.json @@ -0,0 +1,140 @@ +{ + "Entries": [ + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema:get-id?api-version=2021-10", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "3057ff78-a159-11ec-b8de-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Fri, 11 Mar 2022 16:34:56 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked", + "x-ms-error-code": "InvalidRequest" + }, + "ResponseBody": { + "error": { + "code": "InvalidRequest", + "message": "Error when consuming request body: The body of the message cannot be read because it is empty. TrackingId:f951b646-65be-4527-bca8-e5e28144a1a0_G1, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups/fakegroup/schemas/test-schema:get-id, Timestamp:2022-03-11T16:34:57" + } + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema:get-id?api-version=2021-10", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "179", + "Content-Type": "application/json; serialization=Invalid-format", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "30b2f352-a159-11ec-a8ac-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "age", + "type": [ + "int", + "null" + ] + }, + { + "name": "city", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 415, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Fri, 11 Mar 2022 16:34:57 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked", + "x-ms-error-code": "InvalidSchemaType" + }, + "ResponseBody": { + "error": { + "code": "InvalidSchemaType", + "message": "Invalid schema type for POST request. \u0027invalid-format\u0027 is not supported. TrackingId:be7d7dac-14f3-48a5-a58e-8e68de6951ac_G1, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups/fakegroup/schemas/test-schema:get-id, Timestamp:2022-03-11T16:34:58" + } + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/never-registered:get-id?api-version=2021-10", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "179", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "30fbd455-a159-11ec-8db4-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "age", + "type": [ + "int", + "null" + ] + }, + { + "name": "city", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 404, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Fri, 11 Mar 2022 16:34:57 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked", + "x-ms-error-code": "ItemNotFound" + }, + "ResponseBody": { + "error": { + "code": "ItemNotFound", + "message": "Schema fakegroup/never-registered does not exist. TrackingId:d0d8465b-caad-4c8b-95cd-bee62287a90f_G1, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups/fakegroup/schemas/never-registered:get-id, Timestamp:2022-03-11T16:34:58" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_register_schema_errors.json b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_register_schema_errors.json new file mode 100644 index 000000000000..3c5d3e430a5b --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_register_schema_errors.json @@ -0,0 +1,87 @@ +{ + "Entries": [ + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "0", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "2faca65f-a159-11ec-820e-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Fri, 11 Mar 2022 16:34:55 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked", + "x-ms-error-code": "InvalidRequest" + }, + "ResponseBody": { + "error": { + "code": "InvalidRequest", + "message": "Error when consuming request body: The body of the message cannot be read because it is empty. TrackingId:f44b45c2-0ac9-4aef-b4ad-cf31dda1a031_G1, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups/fakegroup/schemas/test-schema, Timestamp:2022-03-11T16:34:56" + } + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "179", + "Content-Type": "application/json; serialization=Invalid-format", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "30090442-a159-11ec-8ae6-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "age", + "type": [ + "int", + "null" + ] + }, + { + "name": "city", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 415, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Fri, 11 Mar 2022 16:34:56 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked", + "x-ms-error-code": "InvalidSchemaType" + }, + "ResponseBody": { + "error": { + "code": "InvalidSchemaType", + "message": "Invalid schema type for PUT request. \u0027invalid-format\u0027 is not supported. TrackingId:8caae4c0-c143-41e7-bf84-b95a790c6f6d_G1, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups/fakegroup/schemas/test-schema, Timestamp:2022-03-11T16:34:56" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_schema_basic_async.json b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_schema_basic_async.json new file mode 100644 index 000000000000..f5988fceddb7 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_schema_basic_async.json @@ -0,0 +1,163 @@ +{ + "Entries": [ + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema-basic-async54a738e0?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "201", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "2b0e8e90-a159-11ec-9158-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Fri, 11 Mar 2022 16:34:48 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-basic-async54a738e0/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "b2aae1e61e9846a981b9b2580cc121d1", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/b2aae1e61e9846a981b9b2580cc121d1?api-version=2021-10", + "Schema-Name": "test-schema-basic-async54a738e0", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-basic-async54a738e0/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/b2aae1e61e9846a981b9b2580cc121d1?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "2ba04afb-a159-11ec-9994-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; serialization=Avro", + "Date": "Fri, 11 Mar 2022 16:34:48 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-basic-async54a738e0/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "b2aae1e61e9846a981b9b2580cc121d1", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/b2aae1e61e9846a981b9b2580cc121d1?api-version=2021-10", + "Schema-Name": "test-schema-basic-async54a738e0", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-basic-async54a738e0/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked" + }, + "ResponseBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema-basic-async54a738e0:get-id?api-version=2021-10", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "201", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "2bf6fb33-a159-11ec-b034-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Fri, 11 Mar 2022 16:34:49 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-basic-async54a738e0/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "b2aae1e61e9846a981b9b2580cc121d1", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/b2aae1e61e9846a981b9b2580cc121d1?api-version=2021-10", + "Schema-Name": "test-schema-basic-async54a738e0", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-basic-async54a738e0/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_schema_negative_no_schema_async.json b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_schema_negative_no_schema_async.json new file mode 100644 index 000000000000..24f88ba2c37f --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_schema_negative_no_schema_async.json @@ -0,0 +1,59 @@ +{ + "Entries": [ + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/a?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "2ee34cfa-a159-11ec-8bc8-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Fri, 11 Mar 2022 16:34:54 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked", + "x-ms-error-code": "InvalidRequest" + }, + "ResponseBody": { + "error": { + "code": "InvalidRequest", + "message": "SubCode=40000, UnknownType:The request is invalid. [MGResponseHttpError=BadRequest]. TrackingId:0cb27dd4-1a9f-46c1-aa49-7deea3a7d22f_G1, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups/$schemas/a, Timestamp:2022-03-11T16:34:55" + } + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "2f56da6b-a159-11ec-a360-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Fri, 11 Mar 2022 16:34:55 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked", + "x-ms-error-code": "ItemNotFound" + }, + "ResponseBody": { + "error": { + "code": "ItemNotFound", + "message": "Schema id aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa does not exist. TrackingId:aabf68a8-b602-4868-aebe-86847720551c_G1, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups/$schemas/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, Timestamp:2022-03-11T16:34:55" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_schema_negative_wrong_credential_async.json b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_schema_negative_wrong_credential_async.json new file mode 100644 index 000000000000..f721723386d8 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_schema_negative_wrong_credential_async.json @@ -0,0 +1,4 @@ +{ + "Entries": [], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_schema_same_twice_async.json b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_schema_same_twice_async.json new file mode 100644 index 000000000000..2ca451baf03c --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_schema_same_twice_async.json @@ -0,0 +1,111 @@ +{ + "Entries": [ + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema-twice-async7cc33aff?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "179", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "2dd572e8-a159-11ec-8e68-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "age", + "type": [ + "int", + "null" + ] + }, + { + "name": "city", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Fri, 11 Mar 2022 16:34:53 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-twice-async7cc33aff/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "17654d26ccf34421ba73953044e014ea", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/17654d26ccf34421ba73953044e014ea?api-version=2021-10", + "Schema-Name": "test-schema-twice-async7cc33aff", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-twice-async7cc33aff/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema-twice-async7cc33aff?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "179", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "2e66f323-a159-11ec-80ef-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "age", + "type": [ + "int", + "null" + ] + }, + { + "name": "city", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Fri, 11 Mar 2022 16:34:53 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-twice-async7cc33aff/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "17654d26ccf34421ba73953044e014ea", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/17654d26ccf34421ba73953044e014ea?api-version=2021-10", + "Schema-Name": "test-schema-twice-async7cc33aff", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-twice-async7cc33aff/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_schema_update_async.json b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_schema_update_async.json new file mode 100644 index 000000000000..e8ca55fe763a --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/async_tests/test_schema_registry_async.pyTestSchemaRegistryAsynctest_schema_update_async.json @@ -0,0 +1,163 @@ +{ + "Entries": [ + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema-update-async907a3961?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "201", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "2c58d91f-a159-11ec-b079-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Fri, 11 Mar 2022 16:34:50 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-update-async907a3961/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "bcb07c8021514e9bbb47faaee48a0718", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/bcb07c8021514e9bbb47faaee48a0718?api-version=2021-10", + "Schema-Name": "test-schema-update-async907a3961", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update-async907a3961/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema-update-async907a3961?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Content-Length": "200", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "2cfdc214-a159-11ec-bd26-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_food", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Fri, 11 Mar 2022 16:34:51 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-update-async907a3961/versions/2?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "d00c880797074a1b9e8c5ffdba2aeb92", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/d00c880797074a1b9e8c5ffdba2aeb92?api-version=2021-10", + "Schema-Name": "test-schema-update-async907a3961", + "Schema-Version": "2", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update-async907a3961/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/d00c880797074a1b9e8c5ffdba2aeb92?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "2d5ab6e3-a159-11ec-a4f8-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; serialization=Avro", + "Date": "Fri, 11 Mar 2022 16:34:51 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-update-async907a3961/versions/2?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "d00c880797074a1b9e8c5ffdba2aeb92", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/d00c880797074a1b9e8c5ffdba2aeb92?api-version=2021-10", + "Schema-Name": "test-schema-update-async907a3961", + "Schema-Version": "2", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update-async907a3961/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked" + }, + "ResponseBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_food", + "type": [ + "string", + "null" + ] + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_get_schema_errors.json b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_get_schema_errors.json new file mode 100644 index 000000000000..9b3d7b4e424a --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_get_schema_errors.json @@ -0,0 +1,207 @@ +{ + "Entries": [ + { + "RequestUri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0/.well-known/openid-configuration", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "1753", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 11 Mar 2022 16:34:46 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=AuTGA0UGvnJPjytarsQ6xUqlEE-xBQAAABhxvdkOAAAA; expires=Sun, 10-Apr-2022 16:34:47 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12529.18 - SCUS ProdSlices", + "x-ms-request-id": "48eb7a34-74fa-4009-bbf9-19f5bcee1d00" + }, + "ResponseBody": { + "token_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token", + "token_endpoint_auth_methods_supported": [ + "client_secret_post", + "private_key_jwt", + "client_secret_basic" + ], + "jwks_uri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/discovery/v2.0/keys", + "response_modes_supported": [ + "query", + "fragment", + "form_post" + ], + "subject_types_supported": [ + "pairwise" + ], + "id_token_signing_alg_values_supported": [ + "RS256" + ], + "response_types_supported": [ + "code", + "id_token", + "code id_token", + "id_token token" + ], + "scopes_supported": [ + "openid", + "profile", + "email", + "offline_access" + ], + "issuer": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0", + "request_uri_parameter_supported": false, + "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", + "authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/authorize", + "device_authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/devicecode", + "http_logout_supported": true, + "frontchannel_logout_supported": true, + "end_session_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/logout", + "claims_supported": [ + "sub", + "iss", + "cloud_instance_name", + "cloud_instance_host_name", + "cloud_graph_host_name", + "msgraph_host", + "aud", + "exp", + "iat", + "auth_time", + "acr", + "nonce", + "preferred_username", + "name", + "tid", + "ver", + "at_hash", + "c_hash", + "email" + ], + "kerberos_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/kerberos", + "tenant_region_scope": "WW", + "cloud_instance_name": "microsoftonline.com", + "cloud_graph_host_name": "graph.windows.net", + "msgraph_host": "graph.microsoft.com", + "rbac_url": "https://pas.windows.net" + } + }, + { + "RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Cookie": "fpc=AuTGA0UGvnJPjytarsQ6xUqlEE-xBQAAABhxvdkOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "945", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 11 Mar 2022 16:34:46 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=AuTGA0UGvnJPjytarsQ6xUqlEE-xBQAAABhxvdkOAAAA; expires=Sun, 10-Apr-2022 16:34:47 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12529.17 - SCUS ProdSlices", + "x-ms-request-id": "22b7f1e2-6d96-463c-a330-9f718394da00" + }, + "ResponseBody": { + "tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration", + "api-version": "1.1", + "metadata": [ + { + "preferred_network": "login.microsoftonline.com", + "preferred_cache": "login.windows.net", + "aliases": [ + "login.microsoftonline.com", + "login.windows.net", + "login.microsoft.com", + "sts.windows.net" + ] + }, + { + "preferred_network": "login.partner.microsoftonline.cn", + "preferred_cache": "login.partner.microsoftonline.cn", + "aliases": [ + "login.partner.microsoftonline.cn", + "login.chinacloudapi.cn" + ] + }, + { + "preferred_network": "login.microsoftonline.de", + "preferred_cache": "login.microsoftonline.de", + "aliases": [ + "login.microsoftonline.de" + ] + }, + { + "preferred_network": "login.microsoftonline.us", + "preferred_cache": "login.microsoftonline.us", + "aliases": [ + "login.microsoftonline.us", + "login.usgovcloudapi.net" + ] + }, + { + "preferred_network": "login-us.microsoftonline.com", + "preferred_cache": "login-us.microsoftonline.com", + "aliases": [ + "login-us.microsoftonline.com" + ] + } + ] + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/fakeschemaid?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "2a670584-a159-11ec-8ae5-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Fri, 11 Mar 2022 16:34:47 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked", + "x-ms-error-code": "InvalidRequest" + }, + "ResponseBody": { + "error": { + "code": "InvalidRequest", + "message": "SubCode=40000, UnknownType:The request is invalid. [MGResponseHttpError=BadRequest]. TrackingId:6ca3ff81-c4d5-4e08-b320-85010d96b43b_G1, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups/$schemas/fakeschemaid, Timestamp:2022-03-11T16:34:47" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_get_schema_properties_errors.json b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_get_schema_properties_errors.json new file mode 100644 index 000000000000..7f8e8f769a85 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_get_schema_properties_errors.json @@ -0,0 +1,317 @@ +{ + "Entries": [ + { + "RequestUri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0/.well-known/openid-configuration", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "1753", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 11 Mar 2022 16:34:44 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=AuTGA0UGvnJPjytarsQ6xUqlEE-xBAAAABhxvdkOAAAA; expires=Sun, 10-Apr-2022 16:34:44 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12529.18 - NCUS ProdSlices", + "x-ms-request-id": "93bcdc47-da70-4805-80d8-a725f2751400" + }, + "ResponseBody": { + "token_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token", + "token_endpoint_auth_methods_supported": [ + "client_secret_post", + "private_key_jwt", + "client_secret_basic" + ], + "jwks_uri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/discovery/v2.0/keys", + "response_modes_supported": [ + "query", + "fragment", + "form_post" + ], + "subject_types_supported": [ + "pairwise" + ], + "id_token_signing_alg_values_supported": [ + "RS256" + ], + "response_types_supported": [ + "code", + "id_token", + "code id_token", + "id_token token" + ], + "scopes_supported": [ + "openid", + "profile", + "email", + "offline_access" + ], + "issuer": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0", + "request_uri_parameter_supported": false, + "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", + "authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/authorize", + "device_authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/devicecode", + "http_logout_supported": true, + "frontchannel_logout_supported": true, + "end_session_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/logout", + "claims_supported": [ + "sub", + "iss", + "cloud_instance_name", + "cloud_instance_host_name", + "cloud_graph_host_name", + "msgraph_host", + "aud", + "exp", + "iat", + "auth_time", + "acr", + "nonce", + "preferred_username", + "name", + "tid", + "ver", + "at_hash", + "c_hash", + "email" + ], + "kerberos_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/kerberos", + "tenant_region_scope": "WW", + "cloud_instance_name": "microsoftonline.com", + "cloud_graph_host_name": "graph.windows.net", + "msgraph_host": "graph.microsoft.com", + "rbac_url": "https://pas.windows.net" + } + }, + { + "RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Cookie": "fpc=AuTGA0UGvnJPjytarsQ6xUqlEE-xBAAAABhxvdkOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "945", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 11 Mar 2022 16:34:44 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=AuTGA0UGvnJPjytarsQ6xUqlEE-xBAAAABhxvdkOAAAA; expires=Sun, 10-Apr-2022 16:34:44 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12529.18 - NCUS ProdSlices", + "x-ms-request-id": "752b46c6-2323-46c2-a65f-1776a14c1800" + }, + "ResponseBody": { + "tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration", + "api-version": "1.1", + "metadata": [ + { + "preferred_network": "login.microsoftonline.com", + "preferred_cache": "login.windows.net", + "aliases": [ + "login.microsoftonline.com", + "login.windows.net", + "login.microsoft.com", + "sts.windows.net" + ] + }, + { + "preferred_network": "login.partner.microsoftonline.cn", + "preferred_cache": "login.partner.microsoftonline.cn", + "aliases": [ + "login.partner.microsoftonline.cn", + "login.chinacloudapi.cn" + ] + }, + { + "preferred_network": "login.microsoftonline.de", + "preferred_cache": "login.microsoftonline.de", + "aliases": [ + "login.microsoftonline.de" + ] + }, + { + "preferred_network": "login.microsoftonline.us", + "preferred_cache": "login.microsoftonline.us", + "aliases": [ + "login.microsoftonline.us", + "login.usgovcloudapi.net" + ] + }, + { + "preferred_network": "login-us.microsoftonline.com", + "preferred_cache": "login-us.microsoftonline.com", + "aliases": [ + "login-us.microsoftonline.com" + ] + } + ] + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema:get-id?api-version=2021-10", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "0", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "290480d9-a159-11ec-a9fd-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Fri, 11 Mar 2022 16:34:45 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked", + "x-ms-error-code": "InvalidRequest" + }, + "ResponseBody": { + "error": { + "code": "InvalidRequest", + "message": "Error when consuming request body: The body of the message cannot be read because it is empty. TrackingId:b48915c2-2222-471d-bf21-b1c30e576d97_G1, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups/fakegroup/schemas/test-schema:get-id, Timestamp:2022-03-11T16:34:45" + } + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema:get-id?api-version=2021-10", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "179", + "Content-Type": "application/json; serialization=Invalid-format", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "29a2a9ed-a159-11ec-8abd-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "age", + "type": [ + "int", + "null" + ] + }, + { + "name": "city", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 415, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Fri, 11 Mar 2022 16:34:45 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked", + "x-ms-error-code": "InvalidSchemaType" + }, + "ResponseBody": { + "error": { + "code": "InvalidSchemaType", + "message": "Invalid schema type for POST request. \u0027invalid-format\u0027 is not supported. TrackingId:5e3d13bb-1b33-4f3a-8602-f71a29fba4e3_G1, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups/fakegroup/schemas/test-schema:get-id, Timestamp:2022-03-11T16:34:46" + } + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/never-registered:get-id?api-version=2021-10", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "179", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "29e85b76-a159-11ec-998e-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "age", + "type": [ + "int", + "null" + ] + }, + { + "name": "city", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 404, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Fri, 11 Mar 2022 16:34:46 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked", + "x-ms-error-code": "ItemNotFound" + }, + "ResponseBody": { + "error": { + "code": "ItemNotFound", + "message": "Schema fakegroup/never-registered does not exist. TrackingId:76a6c735-88be-492c-8a27-e1d5d8d7830e_G1, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups/fakegroup/schemas/never-registered:get-id, Timestamp:2022-03-11T16:34:46" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_register_schema_errors.json b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_register_schema_errors.json new file mode 100644 index 000000000000..c35572e7bf96 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_register_schema_errors.json @@ -0,0 +1,263 @@ +{ + "Entries": [ + { + "RequestUri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0/.well-known/openid-configuration", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "1753", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 11 Mar 2022 16:34:43 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=AuTGA0UGvnJPjytarsQ6xUqlEE-xBAAAABhxvdkOAAAA; expires=Sun, 10-Apr-2022 16:34:43 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12529.18 - NCUS ProdSlices", + "x-ms-request-id": "93bcdc47-da70-4805-80d8-a725b9751400" + }, + "ResponseBody": { + "token_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token", + "token_endpoint_auth_methods_supported": [ + "client_secret_post", + "private_key_jwt", + "client_secret_basic" + ], + "jwks_uri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/discovery/v2.0/keys", + "response_modes_supported": [ + "query", + "fragment", + "form_post" + ], + "subject_types_supported": [ + "pairwise" + ], + "id_token_signing_alg_values_supported": [ + "RS256" + ], + "response_types_supported": [ + "code", + "id_token", + "code id_token", + "id_token token" + ], + "scopes_supported": [ + "openid", + "profile", + "email", + "offline_access" + ], + "issuer": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0", + "request_uri_parameter_supported": false, + "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", + "authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/authorize", + "device_authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/devicecode", + "http_logout_supported": true, + "frontchannel_logout_supported": true, + "end_session_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/logout", + "claims_supported": [ + "sub", + "iss", + "cloud_instance_name", + "cloud_instance_host_name", + "cloud_graph_host_name", + "msgraph_host", + "aud", + "exp", + "iat", + "auth_time", + "acr", + "nonce", + "preferred_username", + "name", + "tid", + "ver", + "at_hash", + "c_hash", + "email" + ], + "kerberos_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/kerberos", + "tenant_region_scope": "WW", + "cloud_instance_name": "microsoftonline.com", + "cloud_graph_host_name": "graph.windows.net", + "msgraph_host": "graph.microsoft.com", + "rbac_url": "https://pas.windows.net" + } + }, + { + "RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Cookie": "fpc=AuTGA0UGvnJPjytarsQ6xUqlEE-xBAAAABhxvdkOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "945", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 11 Mar 2022 16:34:43 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=AuTGA0UGvnJPjytarsQ6xUqlEE-xBAAAABhxvdkOAAAA; expires=Sun, 10-Apr-2022 16:34:43 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12529.17 - NCUS ProdSlices", + "x-ms-request-id": "eefd4350-148a-44cc-b75b-a08500df5900" + }, + "ResponseBody": { + "tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration", + "api-version": "1.1", + "metadata": [ + { + "preferred_network": "login.microsoftonline.com", + "preferred_cache": "login.windows.net", + "aliases": [ + "login.microsoftonline.com", + "login.windows.net", + "login.microsoft.com", + "sts.windows.net" + ] + }, + { + "preferred_network": "login.partner.microsoftonline.cn", + "preferred_cache": "login.partner.microsoftonline.cn", + "aliases": [ + "login.partner.microsoftonline.cn", + "login.chinacloudapi.cn" + ] + }, + { + "preferred_network": "login.microsoftonline.de", + "preferred_cache": "login.microsoftonline.de", + "aliases": [ + "login.microsoftonline.de" + ] + }, + { + "preferred_network": "login.microsoftonline.us", + "preferred_cache": "login.microsoftonline.us", + "aliases": [ + "login.microsoftonline.us", + "login.usgovcloudapi.net" + ] + }, + { + "preferred_network": "login-us.microsoftonline.com", + "preferred_cache": "login-us.microsoftonline.com", + "aliases": [ + "login-us.microsoftonline.com" + ] + } + ] + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "0", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "282de894-a159-11ec-8c97-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Fri, 11 Mar 2022 16:34:43 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked", + "x-ms-error-code": "InvalidRequest" + }, + "ResponseBody": { + "error": { + "code": "InvalidRequest", + "message": "Error when consuming request body: The body of the message cannot be read because it is empty. TrackingId:9cb92090-4314-41cb-8d65-4449830e8454_G1, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups/fakegroup/schemas/test-schema, Timestamp:2022-03-11T16:34:44" + } + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "179", + "Content-Type": "application/json; serialization=Invalid-format", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "28bc2be3-a159-11ec-8a15-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "age", + "type": [ + "int", + "null" + ] + }, + { + "name": "city", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 415, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Fri, 11 Mar 2022 16:34:43 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked", + "x-ms-error-code": "InvalidSchemaType" + }, + "ResponseBody": { + "error": { + "code": "InvalidSchemaType", + "message": "Invalid schema type for PUT request. \u0027invalid-format\u0027 is not supported. TrackingId:2e77d217-33b2-4e21-a636-ce397bfc53e4_G1, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups/fakegroup/schemas/test-schema, Timestamp:2022-03-11T16:34:44" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_schema_basic.json b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_schema_basic.json new file mode 100644 index 000000000000..10dfa7297796 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_schema_basic.json @@ -0,0 +1,341 @@ +{ + "Entries": [ + { + "RequestUri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0/.well-known/openid-configuration", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "1753", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 11 Mar 2022 16:34:32 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=AuTGA0UGvnJPjytarsQ6xUo; expires=Sun, 10-Apr-2022 16:34:33 GMT; path=/; secure; HttpOnly; SameSite=None", + "esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrIPXPthX8A6C0fEgiyTQ-agz5bphqDhaRkQ6-tUh05zmJJBT6JPEFNbS4k1ubGu6-1iNhZqWGrvBEzIs8npYfRjOdRm88V03wJWpWEHa5gPXQeZEgR3OlMpS-z58jtg4bFf74a0c_HDWatgDip1OmR9bt8EDefYXwooS6x1z1ujogAA; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12529.18 - WUS2 ProdSlices", + "x-ms-request-id": "f3f4f440-e2a0-46bb-9dad-8f5cc1871e00" + }, + "ResponseBody": { + "token_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token", + "token_endpoint_auth_methods_supported": [ + "client_secret_post", + "private_key_jwt", + "client_secret_basic" + ], + "jwks_uri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/discovery/v2.0/keys", + "response_modes_supported": [ + "query", + "fragment", + "form_post" + ], + "subject_types_supported": [ + "pairwise" + ], + "id_token_signing_alg_values_supported": [ + "RS256" + ], + "response_types_supported": [ + "code", + "id_token", + "code id_token", + "id_token token" + ], + "scopes_supported": [ + "openid", + "profile", + "email", + "offline_access" + ], + "issuer": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0", + "request_uri_parameter_supported": false, + "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", + "authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/authorize", + "device_authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/devicecode", + "http_logout_supported": true, + "frontchannel_logout_supported": true, + "end_session_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/logout", + "claims_supported": [ + "sub", + "iss", + "cloud_instance_name", + "cloud_instance_host_name", + "cloud_graph_host_name", + "msgraph_host", + "aud", + "exp", + "iat", + "auth_time", + "acr", + "nonce", + "preferred_username", + "name", + "tid", + "ver", + "at_hash", + "c_hash", + "email" + ], + "kerberos_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/kerberos", + "tenant_region_scope": "WW", + "cloud_instance_name": "microsoftonline.com", + "cloud_graph_host_name": "graph.windows.net", + "msgraph_host": "graph.microsoft.com", + "rbac_url": "https://pas.windows.net" + } + }, + { + "RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Cookie": "fpc=AuTGA0UGvnJPjytarsQ6xUo; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "945", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 11 Mar 2022 16:34:32 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=AuTGA0UGvnJPjytarsQ6xUo; expires=Sun, 10-Apr-2022 16:34:33 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12529.17 - EUS ProdSlices", + "x-ms-request-id": "a92c0c4f-bb62-4a12-ac17-7a1cd4677100" + }, + "ResponseBody": { + "tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration", + "api-version": "1.1", + "metadata": [ + { + "preferred_network": "login.microsoftonline.com", + "preferred_cache": "login.windows.net", + "aliases": [ + "login.microsoftonline.com", + "login.windows.net", + "login.microsoft.com", + "sts.windows.net" + ] + }, + { + "preferred_network": "login.partner.microsoftonline.cn", + "preferred_cache": "login.partner.microsoftonline.cn", + "aliases": [ + "login.partner.microsoftonline.cn", + "login.chinacloudapi.cn" + ] + }, + { + "preferred_network": "login.microsoftonline.de", + "preferred_cache": "login.microsoftonline.de", + "aliases": [ + "login.microsoftonline.de" + ] + }, + { + "preferred_network": "login.microsoftonline.us", + "preferred_cache": "login.microsoftonline.us", + "aliases": [ + "login.microsoftonline.us", + "login.usgovcloudapi.net" + ] + }, + { + "preferred_network": "login-us.microsoftonline.com", + "preferred_cache": "login-us.microsoftonline.com", + "aliases": [ + "login-us.microsoftonline.com" + ] + } + ] + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema-basic62b42d09?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "201", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "21c84626-a159-11ec-b494-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Fri, 11 Mar 2022 16:34:34 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-basic62b42d09/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "f899d1f2b7c746dd835a3ec913644c79", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/f899d1f2b7c746dd835a3ec913644c79?api-version=2021-10", + "Schema-Name": "test-schema-basic62b42d09", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-basic62b42d09/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/f899d1f2b7c746dd835a3ec913644c79?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "2309be1f-a159-11ec-aa5d-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; serialization=Avro", + "Date": "Fri, 11 Mar 2022 16:34:34 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-basic62b42d09/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "f899d1f2b7c746dd835a3ec913644c79", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/f899d1f2b7c746dd835a3ec913644c79?api-version=2021-10", + "Schema-Name": "test-schema-basic62b42d09", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-basic62b42d09/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked" + }, + "ResponseBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema-basic62b42d09:get-id?api-version=2021-10", + "RequestMethod": "POST", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "201", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "23773f5d-a159-11ec-af34-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Fri, 11 Mar 2022 16:34:35 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-basic62b42d09/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "f899d1f2b7c746dd835a3ec913644c79", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/f899d1f2b7c746dd835a3ec913644c79?api-version=2021-10", + "Schema-Name": "test-schema-basic62b42d09", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-basic62b42d09/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_schema_negative_no_schema.json b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_schema_negative_no_schema.json new file mode 100644 index 000000000000..05892062be45 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_schema_negative_no_schema.json @@ -0,0 +1,235 @@ +{ + "Entries": [ + { + "RequestUri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0/.well-known/openid-configuration", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "1753", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 11 Mar 2022 16:34:41 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=AuTGA0UGvnJPjytarsQ6xUqlEE-xAwAAABhxvdkOAAAA; expires=Sun, 10-Apr-2022 16:34:41 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12529.18 - WUS2 ProdSlices", + "x-ms-request-id": "f3f4f440-e2a0-46bb-9dad-8f5cae881e00" + }, + "ResponseBody": { + "token_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token", + "token_endpoint_auth_methods_supported": [ + "client_secret_post", + "private_key_jwt", + "client_secret_basic" + ], + "jwks_uri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/discovery/v2.0/keys", + "response_modes_supported": [ + "query", + "fragment", + "form_post" + ], + "subject_types_supported": [ + "pairwise" + ], + "id_token_signing_alg_values_supported": [ + "RS256" + ], + "response_types_supported": [ + "code", + "id_token", + "code id_token", + "id_token token" + ], + "scopes_supported": [ + "openid", + "profile", + "email", + "offline_access" + ], + "issuer": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0", + "request_uri_parameter_supported": false, + "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", + "authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/authorize", + "device_authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/devicecode", + "http_logout_supported": true, + "frontchannel_logout_supported": true, + "end_session_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/logout", + "claims_supported": [ + "sub", + "iss", + "cloud_instance_name", + "cloud_instance_host_name", + "cloud_graph_host_name", + "msgraph_host", + "aud", + "exp", + "iat", + "auth_time", + "acr", + "nonce", + "preferred_username", + "name", + "tid", + "ver", + "at_hash", + "c_hash", + "email" + ], + "kerberos_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/kerberos", + "tenant_region_scope": "WW", + "cloud_instance_name": "microsoftonline.com", + "cloud_graph_host_name": "graph.windows.net", + "msgraph_host": "graph.microsoft.com", + "rbac_url": "https://pas.windows.net" + } + }, + { + "RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Cookie": "fpc=AuTGA0UGvnJPjytarsQ6xUqlEE-xAwAAABhxvdkOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "945", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 11 Mar 2022 16:34:41 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=AuTGA0UGvnJPjytarsQ6xUqlEE-xAwAAABhxvdkOAAAA; expires=Sun, 10-Apr-2022 16:34:41 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12559.4 - SCUS ProdSlices", + "x-ms-request-id": "ac48625b-5ad7-4312-a502-22390a023c00" + }, + "ResponseBody": { + "tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration", + "api-version": "1.1", + "metadata": [ + { + "preferred_network": "login.microsoftonline.com", + "preferred_cache": "login.windows.net", + "aliases": [ + "login.microsoftonline.com", + "login.windows.net", + "login.microsoft.com", + "sts.windows.net" + ] + }, + { + "preferred_network": "login.partner.microsoftonline.cn", + "preferred_cache": "login.partner.microsoftonline.cn", + "aliases": [ + "login.partner.microsoftonline.cn", + "login.chinacloudapi.cn" + ] + }, + { + "preferred_network": "login.microsoftonline.de", + "preferred_cache": "login.microsoftonline.de", + "aliases": [ + "login.microsoftonline.de" + ] + }, + { + "preferred_network": "login.microsoftonline.us", + "preferred_cache": "login.microsoftonline.us", + "aliases": [ + "login.microsoftonline.us", + "login.usgovcloudapi.net" + ] + }, + { + "preferred_network": "login-us.microsoftonline.com", + "preferred_cache": "login-us.microsoftonline.com", + "aliases": [ + "login-us.microsoftonline.com" + ] + } + ] + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/a?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "270d73b6-a159-11ec-bcdb-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Fri, 11 Mar 2022 16:34:41 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked", + "x-ms-error-code": "InvalidRequest" + }, + "ResponseBody": { + "error": { + "code": "InvalidRequest", + "message": "SubCode=40000, UnknownType:The request is invalid. [MGResponseHttpError=BadRequest]. TrackingId:2e288341-a295-48f7-b124-1e7ac90d4aab_G1, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups/$schemas/a, Timestamp:2022-03-11T16:34:42" + } + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "27beee91-a159-11ec-8652-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Content-Type": "application/json", + "Date": "Fri, 11 Mar 2022 16:34:42 GMT", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked", + "x-ms-error-code": "ItemNotFound" + }, + "ResponseBody": { + "error": { + "code": "ItemNotFound", + "message": "Schema id aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa does not exist. TrackingId:f2ec71a4-b752-4cd0-ab7a-01d5c24f5dc0_G1, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups/$schemas/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, Timestamp:2022-03-11T16:34:43" + } + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_schema_negative_wrong_credential.json b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_schema_negative_wrong_credential.json new file mode 100644 index 000000000000..775d86d03ac9 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_schema_negative_wrong_credential.json @@ -0,0 +1,46 @@ +{ + "Entries": [ + { + "RequestUri": "https://login.microsoftonline.com/fake/v2.0/.well-known/openid-configuration", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "private", + "Content-Length": "658", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 11 Mar 2022 16:34:40 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=AuTGA0UGvnJPjytarsQ6xUqlEE-xAwAAABhxvdkOAAAA; expires=Sun, 10-Apr-2022 16:34:41 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12559.4 - EUS ProdSlices", + "x-ms-request-id": "1e02a984-8333-472c-a1d1-57ee8fd93800" + }, + "ResponseBody": { + "error": "invalid_tenant", + "error_description": "AADSTS90002: Tenant \u0027fake\u0027 not found. Check to make sure you have the correct tenant ID and are signing into the correct cloud. Check with your subscription administrator, this may happen if there are no active subscriptions for the tenant.\r\nTrace ID: 1e02a984-8333-472c-a1d1-57ee8fd93800\r\nCorrelation ID: f60d8d04-cbc4-44a8-afdb-46a9bf5292db\r\nTimestamp: 2022-03-11 16:34:41Z", + "error_codes": [ + 90002 + ], + "timestamp": "2022-03-11 16:34:41Z", + "trace_id": "1e02a984-8333-472c-a1d1-57ee8fd93800", + "correlation_id": "f60d8d04-cbc4-44a8-afdb-46a9bf5292db", + "error_uri": "https://login.microsoftonline.com/error?code=90002" + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_schema_same_twice.json b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_schema_same_twice.json new file mode 100644 index 000000000000..bdf8651cbff4 --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_schema_same_twice.json @@ -0,0 +1,287 @@ +{ + "Entries": [ + { + "RequestUri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0/.well-known/openid-configuration", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "1753", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 11 Mar 2022 16:34:38 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=AuTGA0UGvnJPjytarsQ6xUqlEE-xAgAAABhxvdkOAAAA; expires=Sun, 10-Apr-2022 16:34:39 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12529.18 - SCUS ProdSlices", + "x-ms-request-id": "48eb7a34-74fa-4009-bbf9-19f525ed1d00" + }, + "ResponseBody": { + "token_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token", + "token_endpoint_auth_methods_supported": [ + "client_secret_post", + "private_key_jwt", + "client_secret_basic" + ], + "jwks_uri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/discovery/v2.0/keys", + "response_modes_supported": [ + "query", + "fragment", + "form_post" + ], + "subject_types_supported": [ + "pairwise" + ], + "id_token_signing_alg_values_supported": [ + "RS256" + ], + "response_types_supported": [ + "code", + "id_token", + "code id_token", + "id_token token" + ], + "scopes_supported": [ + "openid", + "profile", + "email", + "offline_access" + ], + "issuer": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0", + "request_uri_parameter_supported": false, + "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", + "authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/authorize", + "device_authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/devicecode", + "http_logout_supported": true, + "frontchannel_logout_supported": true, + "end_session_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/logout", + "claims_supported": [ + "sub", + "iss", + "cloud_instance_name", + "cloud_instance_host_name", + "cloud_graph_host_name", + "msgraph_host", + "aud", + "exp", + "iat", + "auth_time", + "acr", + "nonce", + "preferred_username", + "name", + "tid", + "ver", + "at_hash", + "c_hash", + "email" + ], + "kerberos_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/kerberos", + "tenant_region_scope": "WW", + "cloud_instance_name": "microsoftonline.com", + "cloud_graph_host_name": "graph.windows.net", + "msgraph_host": "graph.microsoft.com", + "rbac_url": "https://pas.windows.net" + } + }, + { + "RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Cookie": "fpc=AuTGA0UGvnJPjytarsQ6xUqlEE-xAgAAABhxvdkOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "945", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 11 Mar 2022 16:34:38 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=AuTGA0UGvnJPjytarsQ6xUqlEE-xAgAAABhxvdkOAAAA; expires=Sun, 10-Apr-2022 16:34:39 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12529.18 - EUS ProdSlices", + "x-ms-request-id": "c2360d12-3d88-4d7d-9bff-e79f51a22000" + }, + "ResponseBody": { + "tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration", + "api-version": "1.1", + "metadata": [ + { + "preferred_network": "login.microsoftonline.com", + "preferred_cache": "login.windows.net", + "aliases": [ + "login.microsoftonline.com", + "login.windows.net", + "login.microsoft.com", + "sts.windows.net" + ] + }, + { + "preferred_network": "login.partner.microsoftonline.cn", + "preferred_cache": "login.partner.microsoftonline.cn", + "aliases": [ + "login.partner.microsoftonline.cn", + "login.chinacloudapi.cn" + ] + }, + { + "preferred_network": "login.microsoftonline.de", + "preferred_cache": "login.microsoftonline.de", + "aliases": [ + "login.microsoftonline.de" + ] + }, + { + "preferred_network": "login.microsoftonline.us", + "preferred_cache": "login.microsoftonline.us", + "aliases": [ + "login.microsoftonline.us", + "login.usgovcloudapi.net" + ] + }, + { + "preferred_network": "login-us.microsoftonline.com", + "preferred_cache": "login-us.microsoftonline.com", + "aliases": [ + "login-us.microsoftonline.com" + ] + } + ] + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema-twice4f542f28?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "179", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "25a1ecd8-a159-11ec-8f9c-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "age", + "type": [ + "int", + "null" + ] + }, + { + "name": "city", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Fri, 11 Mar 2022 16:34:39 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-twice4f542f28/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "8ee3150ab59c4332a2a49ba1b91e936a", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/8ee3150ab59c4332a2a49ba1b91e936a?api-version=2021-10", + "Schema-Name": "test-schema-twice4f542f28", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-twice4f542f28/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema-twice4f542f28?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "179", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "26575767-a159-11ec-9cb9-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "age", + "type": [ + "int", + "null" + ] + }, + { + "name": "city", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Fri, 11 Mar 2022 16:34:40 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-twice4f542f28/versions/1?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "8ee3150ab59c4332a2a49ba1b91e936a", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/8ee3150ab59c4332a2a49ba1b91e936a?api-version=2021-10", + "Schema-Name": "test-schema-twice4f542f28", + "Schema-Version": "1", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-twice4f542f28/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_schema_update.json b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_schema_update.json new file mode 100644 index 000000000000..9f8668e5be6a --- /dev/null +++ b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.pyTestSchemaRegistrytest_schema_update.json @@ -0,0 +1,340 @@ +{ + "Entries": [ + { + "RequestUri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0/.well-known/openid-configuration", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "1753", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 11 Mar 2022 16:34:36 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=AuTGA0UGvnJPjytarsQ6xUqlEE-xAQAAABhxvdkOAAAA; expires=Sun, 10-Apr-2022 16:34:36 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12529.18 - EUS ProdSlices", + "x-ms-request-id": "09468a0d-da48-4527-93c6-5c75a7121900" + }, + "ResponseBody": { + "token_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token", + "token_endpoint_auth_methods_supported": [ + "client_secret_post", + "private_key_jwt", + "client_secret_basic" + ], + "jwks_uri": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/discovery/v2.0/keys", + "response_modes_supported": [ + "query", + "fragment", + "form_post" + ], + "subject_types_supported": [ + "pairwise" + ], + "id_token_signing_alg_values_supported": [ + "RS256" + ], + "response_types_supported": [ + "code", + "id_token", + "code id_token", + "id_token token" + ], + "scopes_supported": [ + "openid", + "profile", + "email", + "offline_access" + ], + "issuer": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0", + "request_uri_parameter_supported": false, + "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", + "authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/authorize", + "device_authorization_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/devicecode", + "http_logout_supported": true, + "frontchannel_logout_supported": true, + "end_session_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/logout", + "claims_supported": [ + "sub", + "iss", + "cloud_instance_name", + "cloud_instance_host_name", + "cloud_graph_host_name", + "msgraph_host", + "aud", + "exp", + "iat", + "auth_time", + "acr", + "nonce", + "preferred_username", + "name", + "tid", + "ver", + "at_hash", + "c_hash", + "email" + ], + "kerberos_endpoint": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/kerberos", + "tenant_region_scope": "WW", + "cloud_instance_name": "microsoftonline.com", + "cloud_graph_host_name": "graph.windows.net", + "msgraph_host": "graph.microsoft.com", + "rbac_url": "https://pas.windows.net" + } + }, + { + "RequestUri": "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1\u0026authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Cookie": "fpc=AuTGA0UGvnJPjytarsQ6xUqlEE-xAQAAABhxvdkOAAAA; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd", + "User-Agent": "azsdk-python-identity/1.9.0b2 Python/3.9.0 (Windows-10-10.0.22000-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Access-Control-Allow-Methods": "GET, OPTIONS", + "Access-Control-Allow-Origin": "*", + "Cache-Control": "max-age=86400, private", + "Content-Length": "945", + "Content-Type": "application/json; charset=utf-8", + "Date": "Fri, 11 Mar 2022 16:34:36 GMT", + "P3P": "CP=\u0022DSP CUR OTPi IND OTRi ONL FIN\u0022", + "Set-Cookie": [ + "fpc=AuTGA0UGvnJPjytarsQ6xUqlEE-xAQAAABhxvdkOAAAA; expires=Sun, 10-Apr-2022 16:34:36 GMT; path=/; secure; HttpOnly; SameSite=None", + "x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly", + "stsservicecookie=estsfd; path=/; secure; samesite=none; httponly" + ], + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-ests-server": "2.1.12559.4 - SCUS ProdSlices", + "x-ms-request-id": "e785887f-5c79-4937-b182-deaba7ac3700" + }, + "ResponseBody": { + "tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.well-known/openid-configuration", + "api-version": "1.1", + "metadata": [ + { + "preferred_network": "login.microsoftonline.com", + "preferred_cache": "login.windows.net", + "aliases": [ + "login.microsoftonline.com", + "login.windows.net", + "login.microsoft.com", + "sts.windows.net" + ] + }, + { + "preferred_network": "login.partner.microsoftonline.cn", + "preferred_cache": "login.partner.microsoftonline.cn", + "aliases": [ + "login.partner.microsoftonline.cn", + "login.chinacloudapi.cn" + ] + }, + { + "preferred_network": "login.microsoftonline.de", + "preferred_cache": "login.microsoftonline.de", + "aliases": [ + "login.microsoftonline.de" + ] + }, + { + "preferred_network": "login.microsoftonline.us", + "preferred_cache": "login.microsoftonline.us", + "aliases": [ + "login.microsoftonline.us", + "login.usgovcloudapi.net" + ] + }, + { + "preferred_network": "login-us.microsoftonline.com", + "preferred_cache": "login-us.microsoftonline.com", + "aliases": [ + "login-us.microsoftonline.com" + ] + } + ] + } + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema-update92272d8a?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "201", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "23f5f0cd-a159-11ec-a15f-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_color", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Fri, 11 Mar 2022 16:34:36 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-update92272d8a/versions/3?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "79a4e4672c8b4468a29dc2bb3160dc43", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/79a4e4672c8b4468a29dc2bb3160dc43?api-version=2021-10", + "Schema-Name": "test-schema-update92272d8a", + "Schema-Version": "3", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update92272d8a/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema-update92272d8a?api-version=2021-10", + "RequestMethod": "PUT", + "RequestHeaders": { + "Accept": "application/json", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "Content-Length": "200", + "Content-Type": "application/json; serialization=Avro", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "24b5bf96-a159-11ec-9531-9c2976df0bde" + }, + "RequestBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_food", + "type": [ + "string", + "null" + ] + } + ] + }, + "StatusCode": 204, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Fri, 11 Mar 2022 16:34:37 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-update92272d8a/versions/4?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "114aeeb4f80a43859a6c37976c2c465e", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/114aeeb4f80a43859a6c37976c2c465e?api-version=2021-10", + "Schema-Name": "test-schema-update92272d8a", + "Schema-Version": "4", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update92272d8a/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000" + }, + "ResponseBody": null + }, + { + "RequestUri": "https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/114aeeb4f80a43859a6c37976c2c465e?api-version=2021-10", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json; serialization=Avro", + "Accept-Encoding": "gzip, deflate", + "Authorization": "Sanitized", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0)", + "x-ms-client-request-id": "250e85f9-a159-11ec-ad11-9c2976df0bde" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Type": "application/json; serialization=Avro", + "Date": "Fri, 11 Mar 2022 16:34:38 GMT", + "Location": "https://fake_resource.servicebus.windows.net/$schemagroups/fakegroup/schemas/test-schema-update92272d8a/versions/4?api-version=2021-10", + "Schema-Group-Name": "fakegroup", + "Schema-Id": "114aeeb4f80a43859a6c37976c2c465e", + "Schema-Id-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/$schemas/114aeeb4f80a43859a6c37976c2c465e?api-version=2021-10", + "Schema-Name": "test-schema-update92272d8a", + "Schema-Version": "4", + "Schema-Versions-Location": "https://fake_resource.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update92272d8a/versions?api-version=2021-10", + "Server": "Microsoft-HTTPAPI/2.0", + "Strict-Transport-Security": "max-age=31536000", + "Transfer-Encoding": "chunked" + }, + "ResponseBody": { + "namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "favorite_number", + "type": [ + "int", + "null" + ] + }, + { + "name": "favorite_food", + "type": [ + "string", + "null" + ] + } + ] + } + } + ], + "Variables": {} +} diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_get_schema_errors.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_get_schema_errors.yaml deleted file mode 100644 index a2850f6a16fa..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_get_schema_errors.yaml +++ /dev/null @@ -1,37 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/fakeschemaid?api-version=2021-10 - response: - body: - string: '{"error":{"code":"InvalidRequest","message":"SubCode=40000, UnknownType:The - request is invalid. [MGResponseHttpError=BadRequest]. TrackingId:c417fd18-499c-4e17-83dd-5910c8ea9937_G42, - SystemTracker:swathip-test-eh-westus.servicebus.windows.net:$schemaGroups\/$schemas\/fakeschemaid, - Timestamp:2022-02-25T20:18:40"}}' - headers: - content-type: - - application/json - date: - - Fri, 25 Feb 2022 20:18:40 GMT - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - x-ms-error-code: - - InvalidRequest - status: - code: 400 - message: Bad Request -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_get_schema_properties_errors.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_get_schema_properties_errors.yaml deleted file mode 100644 index 3b2314f52df7..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_get_schema_properties_errors.yaml +++ /dev/null @@ -1,118 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema:get-id?api-version=2021-10 - response: - body: - string: '{"error":{"code":"InvalidRequest","message":"Error when consuming request - body: The body of the message cannot be read because it is empty. TrackingId:e02461fb-40f7-492a-abb6-11596ffd1c1b_G10, - SystemTracker:swathip-test-eh-westus.servicebus.windows.net:$schemaGroups\/fakegroup\/schemas\/test-schema:get-id, - Timestamp:2022-02-25T20:18:41"}}' - headers: - content-type: - - application/json - date: - - Fri, 25 Feb 2022 20:18:41 GMT - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - x-ms-error-code: - - InvalidRequest - status: - code: 400 - message: Bad Request -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '179' - Content-Type: - - application/json; serialization=Invalid-format - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema:get-id?api-version=2021-10 - response: - body: - string: '{"error":{"code":"InvalidSchemaType","message":"Invalid schema type - for POST request. ''invalid-format'' is not supported. TrackingId:74a0f7cc-118d-4eea-82ca-9088627c7640_G10, - SystemTracker:swathip-test-eh-westus.servicebus.windows.net:$schemaGroups\/fakegroup\/schemas\/test-schema:get-id, - Timestamp:2022-02-25T20:18:42"}}' - headers: - content-type: - - application/json - date: - - Fri, 25 Feb 2022 20:18:42 GMT - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - x-ms-error-code: - - InvalidSchemaType - status: - code: 415 - message: Unsupported Media Type -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '179' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/never-registered:get-id?api-version=2021-10 - response: - body: - string: '{"error":{"code":"ItemNotFound","message":"Schema fakegroup\/never-registered - does not exist. TrackingId:494d5d0b-9244-4315-8aac-0743f6a6b37c_G10, SystemTracker:swathip-test-eh-westus.servicebus.windows.net:$schemaGroups\/fakegroup\/schemas\/never-registered:get-id, - Timestamp:2022-02-25T20:18:43"}}' - headers: - content-type: - - application/json - date: - - Fri, 25 Feb 2022 20:18:43 GMT - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - x-ms-error-code: - - ItemNotFound - status: - code: 404 - message: Not Found -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_register_schema_errors.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_register_schema_errors.yaml deleted file mode 100644 index 195f7a77fd97..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_register_schema_errors.yaml +++ /dev/null @@ -1,80 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema?api-version=2021-10 - response: - body: - string: '{"error":{"code":"InvalidRequest","message":"Error when consuming request - body: The body of the message cannot be read because it is empty. TrackingId:bfadb65e-af20-4abf-b353-4b365d880798_G15, - SystemTracker:swathip-test-eh-westus.servicebus.windows.net:$schemaGroups\/fakegroup\/schemas\/test-schema, - Timestamp:2022-02-25T20:18:44"}}' - headers: - content-type: - - application/json - date: - - Fri, 25 Feb 2022 20:18:45 GMT - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - x-ms-error-code: - - InvalidRequest - status: - code: 400 - message: Bad Request -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '179' - Content-Type: - - application/json; serialization=Invalid-format - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema?api-version=2021-10 - response: - body: - string: '{"error":{"code":"InvalidSchemaType","message":"Invalid schema type - for PUT request. ''invalid-format'' is not supported. TrackingId:002e0fb7-ebb5-46af-b816-1f391de082d3_G15, - SystemTracker:swathip-test-eh-westus.servicebus.windows.net:$schemaGroups\/fakegroup\/schemas\/test-schema, - Timestamp:2022-02-25T20:18:45"}}' - headers: - content-type: - - application/json - date: - - Fri, 25 Feb 2022 20:18:45 GMT - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - x-ms-error-code: - - InvalidSchemaType - status: - code: 415 - message: Unsupported Media Type -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_basic.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_basic.yaml deleted file mode 100644 index e7e062a31e20..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_basic.yaml +++ /dev/null @@ -1,138 +0,0 @@ -interactions: -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '201' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema-basic31c70f88?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Fri, 25 Feb 2022 20:18:47 GMT - location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-basic31c70f88/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 9b1354170f4046bb9b99e3e6b446f975 - schema-id-location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/$schemas/9b1354170f4046bb9b99e3e6b446f975?api-version=2021-10 - schema-name: - - test-schema-basic31c70f88 - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-basic31c70f88/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/9b1354170f4046bb9b99e3e6b446f975?api-version=2021-10 - response: - body: - string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - content-type: - - application/json;serialization=Avro - date: - - Fri, 25 Feb 2022 20:18:47 GMT - location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-basic31c70f88/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 9b1354170f4046bb9b99e3e6b446f975 - schema-id-location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/$schemas/9b1354170f4046bb9b99e3e6b446f975?api-version=2021-10 - schema-name: - - test-schema-basic31c70f88 - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-basic31c70f88/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 200 - message: OK -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '201' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema-basic31c70f88:get-id?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Fri, 25 Feb 2022 20:18:48 GMT - location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-basic31c70f88/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 9b1354170f4046bb9b99e3e6b446f975 - schema-id-location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/$schemas/9b1354170f4046bb9b99e3e6b446f975?api-version=2021-10 - schema-name: - - test-schema-basic31c70f88 - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-basic31c70f88/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_check_error_code.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_check_error_code.yaml deleted file mode 100644 index 2afb022e1d23..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_check_error_code.yaml +++ /dev/null @@ -1,35 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/a?api-version=2021-10 - response: - body: - string: '{"Code":400,"Detail":"SubCode=40000, UnknownType:The request is invalid. - [MGResponseHttpError=BadRequest]. TrackingId:91e67bd2-4c46-46ef-a8ce-cbc84a61cad3_G29, - SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups\/$schemas\/a, - Timestamp:2022-02-18T00:15:11"}' - headers: - content-type: - - application/json - date: - - Fri, 18 Feb 2022 00:15:11 GMT - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 400 - message: Bad Request -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_check_error_codes.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_check_error_codes.yaml deleted file mode 100644 index 4caab09c9ea3..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_check_error_codes.yaml +++ /dev/null @@ -1,38 +0,0 @@ -interactions: -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '179' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/non-existent-schemac1e147a:get-id?api-version=2021-10 - response: - body: - string: '{"Code":404,"Detail":"Schema fakegroup\/non-existent-schemac1e147a - does not exist. TrackingId:66ce0fc0-336c-4db8-bb6e-87a5444066a0_G24, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups\/fakegroup\/schemas\/non-existent-schemac1e147a:get-id, - Timestamp:2022-02-18T00:34:12"}' - headers: - content-type: - - application/json - date: - - Fri, 18 Feb 2022 00:34:12 GMT - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 404 - message: Not Found -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_error_codes.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_error_codes.yaml deleted file mode 100644 index fcb7b542f127..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_error_codes.yaml +++ /dev/null @@ -1,193 +0,0 @@ -interactions: -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '179' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Fri, 18 Feb 2022 21:27:32 GMT - location: - - https://fake_resource.servicebus.windows.net/:443/$schemagroups/fakegroup/schemas/test-schema/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 709bb53f7e0a439a99880df9c98a5f19 - schema-id-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/$schemas/709bb53f7e0a439a99880df9c98a5f19?api-version=2021-10 - schema-name: - - test-schema - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eventhubs.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema:get-id?api-version=2021-10 - response: - body: - string: '{"Code":400,"Detail":"Error when consuming request body: The body of - the message cannot be read because it is empty. TrackingId:e070b2f0-b7c1-4bfc-b1e8-a5f3604e334c_G13, - SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups\/fakegroup\/schemas\/test-schema:get-id, - Timestamp:2022-02-18T21:27:33"}' - headers: - content-type: - - application/json - date: - - Fri, 18 Feb 2022 21:27:33 GMT - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 400 - message: Bad Request -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '179' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/never-registered:get-id?api-version=2021-10 - response: - body: - string: '{"Code":404,"Detail":"Schema fakegroup\/never-registered does not exist. - TrackingId:d7e04c38-0c57-4b35-b47a-63888ad7bffb_G13, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups\/fakegroup\/schemas\/never-registered:get-id, - Timestamp:2022-02-18T21:27:33"}' - headers: - content-type: - - application/json - date: - - Fri, 18 Feb 2022 21:27:33 GMT - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 404 - message: Not Found -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '179' - Content-Type: - - application/json; serialization=Invalid-format - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema:get-id?api-version=2021-10 - response: - body: - string: '{"Code":415,"Detail":"Invalid schema type for POST request. ''invalid-format'' - is not supported. TrackingId:664e670d-117d-4589-b838-6e4f7f7bb74e_G13, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups\/fakegroup\/schemas\/test-schema:get-id, - Timestamp:2022-02-18T21:27:34"}' - headers: - content-type: - - application/json - date: - - Fri, 18 Feb 2022 21:27:34 GMT - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 415 - message: Unsupported Media Type -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '179' - Content-Type: - - application/json; serialization=Invalid-format - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: POST - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema:get-id?api-version=2021-10 - response: - body: - string: '{"Code":415,"Detail":"Invalid schema type for POST request. ''invalid-format'' - is not supported. TrackingId:e5a6c812-687e-4226-99a6-56ba03a29f1f_G13, SystemTracker:fake_resource.servicebus.windows.net/:$schemaGroups\/fakegroup\/schemas\/test-schema:get-id, - Timestamp:2022-02-18T21:27:34"}' - headers: - content-type: - - application/json - date: - - Fri, 18 Feb 2022 21:27:34 GMT - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 415 - message: Unsupported Media Type -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_negative_no_schema.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_negative_no_schema.yaml deleted file mode 100644 index 8ef29e902b6d..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_negative_no_schema.yaml +++ /dev/null @@ -1,71 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/a?api-version=2021-10 - response: - body: - string: '{"error":{"code":"InvalidRequest","message":"SubCode=40000, UnknownType:The - request is invalid. [MGResponseHttpError=BadRequest]. TrackingId:923cad80-a1c2-4b27-a6d5-a030838d91a0_G31, - SystemTracker:swathip-test-eh-westus.servicebus.windows.net:$schemaGroups\/$schemas\/a, - Timestamp:2022-02-25T20:18:50"}}' - headers: - content-type: - - application/json - date: - - Fri, 25 Feb 2022 20:18:50 GMT - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - x-ms-error-code: - - InvalidRequest - status: - code: 400 - message: Bad Request -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa?api-version=2021-10 - response: - body: - string: '{"error":{"code":"ItemNotFound","message":"Schema id aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - does not exist. TrackingId:86a7730e-eb05-4e05-962d-8a522f5298d2_G31, SystemTracker:swathip-test-eh-westus.servicebus.windows.net:$schemaGroups\/$schemas\/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, - Timestamp:2022-02-25T20:18:51"}}' - headers: - content-type: - - application/json - date: - - Fri, 25 Feb 2022 20:18:50 GMT - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - x-ms-error-code: - - ItemNotFound - status: - code: 404 - message: Not Found -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_same_twice.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_same_twice.yaml deleted file mode 100644 index 586e3f42e587..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_same_twice.yaml +++ /dev/null @@ -1,94 +0,0 @@ -interactions: -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '179' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema-twice863b11a7?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Fri, 25 Feb 2022 20:18:59 GMT - location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-twice863b11a7/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - ce5b9f31e14c46eb81ddb2b2b5cadafd - schema-id-location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/$schemas/ce5b9f31e14c46eb81ddb2b2b5cadafd?api-version=2021-10 - schema-name: - - test-schema-twice863b11a7 - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-twice863b11a7/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '179' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema-twice863b11a7?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Fri, 25 Feb 2022 20:18:59 GMT - location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-twice863b11a7/versions/1?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - ce5b9f31e14c46eb81ddb2b2b5cadafd - schema-id-location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/$schemas/ce5b9f31e14c46eb81ddb2b2b5cadafd?api-version=2021-10 - schema-name: - - test-schema-twice863b11a7 - schema-version: - - '1' - schema-versions-location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-twice863b11a7/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_update.yaml b/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_update.yaml deleted file mode 100644 index 8c05512cafcd..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry/tests/recordings/test_schema_registry.test_schema_update.yaml +++ /dev/null @@ -1,138 +0,0 @@ -interactions: -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '201' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema-update423f1009?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Fri, 25 Feb 2022 20:19:02 GMT - location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/3?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - 1feb7e2f822a4b8aa042f301e60ab1ee - schema-id-location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/$schemas/1feb7e2f822a4b8aa042f301e60ab1ee?api-version=2021-10 - schema-name: - - test-schema-update423f1009 - schema-version: - - '3' - schema-versions-location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update423f1009/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_food","type":["string","null"]}]}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '200' - Content-Type: - - application/json; serialization=Avro - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: PUT - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/fakegroup/schemas/test-schema-update423f1009?api-version=2021-10 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Fri, 25 Feb 2022 20:19:02 GMT - location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/4?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - c00b64afe34e4404b0a5effbdc62bca5 - schema-id-location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/$schemas/c00b64afe34e4404b0a5effbdc62bca5?api-version=2021-10 - schema-name: - - test-schema-update423f1009 - schema-version: - - '4' - schema-versions-location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update423f1009/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json; serialization=Avro - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azureschemaregistry/1.0.0 Python/3.9.0 (Windows-10-10.0.22000-SP0) - method: GET - uri: https://fake_resource.servicebus.windows.net/$schemaGroups/$schemas/c00b64afe34e4404b0a5effbdc62bca5?api-version=2021-10 - response: - body: - string: '{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_food","type":["string","null"]}]}' - headers: - content-type: - - application/json;serialization=Avro - date: - - Fri, 25 Feb 2022 20:19:03 GMT - location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/fakegroup/schemas/test-schema-update423f1009/versions/4?api-version=2021-10 - schema-group-name: - - swathip-test-schema - schema-id: - - c00b64afe34e4404b0a5effbdc62bca5 - schema-id-location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/$schemas/c00b64afe34e4404b0a5effbdc62bca5?api-version=2021-10 - schema-name: - - test-schema-update423f1009 - schema-version: - - '4' - schema-versions-location: - - https://swathip-test-eh-westus.servicebus.windows.net:443/$schemagroups/swathip-test-schema/schemas/test-schema-update423f1009/versions?api-version=2021-10 - server: - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000 - transfer-encoding: - - chunked - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/schemaregistry_preparer.py b/sdk/schemaregistry/azure-schemaregistry/tests/schemaregistry_preparer.py deleted file mode 100644 index b14b923f482b..000000000000 --- a/sdk/schemaregistry/azure-schemaregistry/tests/schemaregistry_preparer.py +++ /dev/null @@ -1,72 +0,0 @@ -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# -------------------------------------------------------------------------- - -import functools -import hashlib -import os -from collections import namedtuple - -from azure.identity import ClientSecretCredential -from azure_devtools.scenario_tests.exceptions import AzureTestError -from devtools_testutils import ( - ResourceGroupPreparer, AzureMgmtPreparer, FakeResource -) - - -SCHEMAREGISTRY_FULLY_QUALIFIED_NAMESPACE_PARAM = "schemaregistry_fully_qualified_namespace" -SCHEMAREGISTRY_GROUP_PARAM = "schemaregistry_group" -SCHEMAREGISTRY_FULLY_QUALIFIED_NAMESPACE_ENV_KEY_NAME = 'SCHEMAREGISTRY_FULLY_QUALIFIED_NAMESPACE' -SCHEMAREGISTRY_GROUP_ENV_KEY_NAME = 'SCHEMAREGISTRY_GROUP' - - -class SchemaRegistryNamespacePreparer(AzureMgmtPreparer): - # TODO: SR doesn't have mgmt package - def __init__(self): - pass - - def create_resource(self, name, **kwargs): - pass - - def remove_resource(self, name, **kwargs): - pass - - -class SchemaRegistryPreparer(AzureMgmtPreparer): - def __init__( - self, - name_prefix='' - ): - super(SchemaRegistryPreparer, self).__init__(name_prefix, 24) - - def create_resource(self, name, **kwargs): - # TODO: right now the endpoint/group is fixed, as there is no way to create/delete resources using api, in the future we should be able to dynamically create and remove resources - if self.is_live: - return { - SCHEMAREGISTRY_FULLY_QUALIFIED_NAMESPACE_PARAM: os.environ[SCHEMAREGISTRY_FULLY_QUALIFIED_NAMESPACE_ENV_KEY_NAME], - SCHEMAREGISTRY_GROUP_PARAM: os.environ[SCHEMAREGISTRY_GROUP_ENV_KEY_NAME] - } - else: - return { - SCHEMAREGISTRY_FULLY_QUALIFIED_NAMESPACE_PARAM: "sr-playground.servicebus.windows.net", - SCHEMAREGISTRY_GROUP_PARAM: "azsdk_python_test_group" - } - - def remove_resource(self, name, **kwargs): - pass diff --git a/sdk/schemaregistry/azure-schemaregistry/tests/test_schema_registry.py b/sdk/schemaregistry/azure-schemaregistry/tests/test_schema_registry.py index 576296d4a5d7..b52fd23b06ba 100644 --- a/sdk/schemaregistry/azure-schemaregistry/tests/test_schema_registry.py +++ b/sdk/schemaregistry/azure-schemaregistry/tests/test_schema_registry.py @@ -25,20 +25,23 @@ from azure.identity import ClientSecretCredential from azure.core.exceptions import ClientAuthenticationError, ServiceRequestError, HttpResponseError -from devtools_testutils import AzureTestCase, PowerShellPreparer +from devtools_testutils import AzureRecordedTestCase, EnvironmentVariableLoader, recorded_by_proxy -SchemaRegistryPowerShellPreparer = functools.partial(PowerShellPreparer, "schemaregistry", schemaregistry_fully_qualified_namespace="fake_resource.servicebus.windows.net/", schemaregistry_group="fakegroup") +SchemaRegistryEnvironmentVariableLoader = functools.partial(EnvironmentVariableLoader, "schemaregistry", schemaregistry_fully_qualified_namespace="fake_resource.servicebus.windows.net/", schemaregistry_group="fakegroup") +class TestSchemaRegistry(AzureRecordedTestCase): -class SchemaRegistryTests(AzureTestCase): - - def create_client(self, fully_qualified_namespace): + def create_client(self, **kwargs): + fully_qualified_namespace = kwargs.pop("fully_qualified_namespace") credential = self.get_credential(SchemaRegistryClient) return self.create_client_from_credential(SchemaRegistryClient, credential, fully_qualified_namespace=fully_qualified_namespace) - @SchemaRegistryPowerShellPreparer() - def test_schema_basic(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - client = self.create_client(schemaregistry_fully_qualified_namespace) + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy + def test_schema_basic(self, **kwargs): + schemaregistry_fully_qualified_namespace = kwargs.pop("schemaregistry_fully_qualified_namespace") + schemaregistry_group = kwargs.pop("schemaregistry_group") + client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) name = self.get_resource_name('test-schema-basic') schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" format = "Avro" @@ -58,9 +61,12 @@ def test_schema_basic(self, schemaregistry_fully_qualified_namespace, schemaregi assert returned_schema_properties.id == schema_properties.id assert returned_schema_properties.format == "Avro" - @SchemaRegistryPowerShellPreparer() - def test_schema_update(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - client = self.create_client(schemaregistry_fully_qualified_namespace) + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy + def test_schema_update(self, **kwargs): + schemaregistry_fully_qualified_namespace = kwargs.pop("schemaregistry_fully_qualified_namespace") + schemaregistry_group = kwargs.pop("schemaregistry_group") + client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) name = self.get_resource_name('test-schema-update') schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" format = "Avro" @@ -82,9 +88,12 @@ def test_schema_update(self, schemaregistry_fully_qualified_namespace, schemareg assert new_schema.definition == schema_str_new assert new_schema.properties.format == "Avro" - @SchemaRegistryPowerShellPreparer() - def test_schema_same_twice(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - client = self.create_client(schemaregistry_fully_qualified_namespace) + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy + def test_schema_same_twice(self, **kwargs): + schemaregistry_fully_qualified_namespace = kwargs.pop("schemaregistry_fully_qualified_namespace") + schemaregistry_group = kwargs.pop("schemaregistry_group") + client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) name = self.get_resource_name('test-schema-twice') schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}""" format = "Avro" @@ -92,8 +101,12 @@ def test_schema_same_twice(self, schemaregistry_fully_qualified_namespace, schem schema_properties_second = client.register_schema(schemaregistry_group, name, schema_str, format) assert schema_properties.id == schema_properties_second.id - @SchemaRegistryPowerShellPreparer() - def test_schema_negative_wrong_credential(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy + def test_schema_negative_wrong_credential(self, **kwargs): + schemaregistry_fully_qualified_namespace = kwargs.pop("schemaregistry_fully_qualified_namespace") + print(schemaregistry_fully_qualified_namespace) + schemaregistry_group = kwargs.pop("schemaregistry_group") credential = ClientSecretCredential(tenant_id="fake", client_id="fake", client_secret="fake") client = SchemaRegistryClient(fully_qualified_namespace=schemaregistry_fully_qualified_namespace, credential=credential) name = self.get_resource_name('test-schema-negative') @@ -102,27 +115,34 @@ def test_schema_negative_wrong_credential(self, schemaregistry_fully_qualified_n with pytest.raises(ClientAuthenticationError): client.register_schema(schemaregistry_group, name, schema_str, format) - @SchemaRegistryPowerShellPreparer() - def test_schema_negative_wrong_endpoint(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - client = self.create_client("nonexist.servicebus.windows.net") + @pytest.mark.skip('test proxy/CI gives HttpResponseError, live test pipeline gives ServiceRequestError') + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy + def test_schema_negative_wrong_endpoint(self, **kwargs): + schemaregistry_group = kwargs.pop("schemaregistry_group") + client = self.create_client(fully_qualified_namespace="nonexist.servicebus.windows.net") name = self.get_resource_name('test-schema-nonexist') schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"favorite_number","type":["int","null"]},{"name":"favorite_color","type":["string","null"]}]}""" format = "Avro" with pytest.raises(ServiceRequestError): client.register_schema(schemaregistry_group, name, schema_str, format) - @SchemaRegistryPowerShellPreparer() - def test_schema_negative_no_schema(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - client = self.create_client(schemaregistry_fully_qualified_namespace) + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy + def test_schema_negative_no_schema(self, **kwargs): + schemaregistry_fully_qualified_namespace = kwargs.pop("schemaregistry_fully_qualified_namespace") + schemaregistry_group = kwargs.pop("schemaregistry_group") + client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) with pytest.raises(HttpResponseError): client.get_schema('a') with pytest.raises(HttpResponseError): client.get_schema('a' * 32) - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy def test_register_schema_errors(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - client = self.create_client(schemaregistry_fully_qualified_namespace) + client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) name = 'test-schema' schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}""" format = "Avro" @@ -149,9 +169,10 @@ def test_register_schema_errors(self, schemaregistry_fully_qualified_namespace, assert e.value.reason == 'Unsupported Media Type' - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy def test_get_schema_properties_errors(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - client = self.create_client(schemaregistry_fully_qualified_namespace) + client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) name = 'test-schema' schema_str = """{"namespace":"example.avro","type":"record","name":"User","fields":[{"name":"name","type":"string"},{"name":"age","type":["int","null"]},{"name":"city","type":["string","null"]}]}""" format = "Avro" @@ -183,9 +204,10 @@ def test_get_schema_properties_errors(self, schemaregistry_fully_qualified_names assert e.value.status_code == 404 assert e.value.reason == 'Not Found' - @SchemaRegistryPowerShellPreparer() + @SchemaRegistryEnvironmentVariableLoader() + @recorded_by_proxy def test_get_schema_errors(self, schemaregistry_fully_qualified_namespace, schemaregistry_group, **kwargs): - client = self.create_client(schemaregistry_fully_qualified_namespace) + client = self.create_client(fully_qualified_namespace=schemaregistry_fully_qualified_namespace) with pytest.raises(ValueError) as e: client.get_schema(None) diff --git a/sdk/schemaregistry/ci.yml b/sdk/schemaregistry/ci.yml index b6780916d15d..a680610888b5 100644 --- a/sdk/schemaregistry/ci.yml +++ b/sdk/schemaregistry/ci.yml @@ -31,4 +31,5 @@ extends: - name: azure-schemaregistry safeName: azureschemaregistry - name: azure-schemaregistry-avroencoder - safeName: azureschemaregistryavroencoder \ No newline at end of file + safeName: azureschemaregistryavroencoder + TestProxy: true \ No newline at end of file diff --git a/sdk/schemaregistry/tests.yml b/sdk/schemaregistry/tests.yml index 0f7e7316a77b..e68d79e6577b 100644 --- a/sdk/schemaregistry/tests.yml +++ b/sdk/schemaregistry/tests.yml @@ -13,6 +13,7 @@ stages: AZURE_CLIENT_SECRET: $(python-schema-registry-sdk-test-client-secret) SCHEMAREGISTRY_FULLY_QUALIFIED_NAMESPACE: $(python-schema-registry-sdk-test-endpoint) SCHEMAREGISTRY_GROUP: $(python-schema-registry-sdk-test-group) + AZURE_SKIP_LIVE_RECORDING: 'True' AZURE_TEST_RUN_LIVE: 'true' MatrixFilters: - '"PythonVersion=^(?!pypy3).*"'