diff --git a/unit_tests/sources/declarative/resolvers/test_http_components_resolver.py b/unit_tests/sources/declarative/resolvers/test_http_components_resolver.py index 09d069bff..3ced049a9 100644 --- a/unit_tests/sources/declarative/resolvers/test_http_components_resolver.py +++ b/unit_tests/sources/declarative/resolvers/test_http_components_resolver.py @@ -281,9 +281,21 @@ def to_configured_catalog( }, "record_selector": { "type": "RecordSelector", - "extractor": {"type": "DpathExtractor", "field_path": []}, + "extractor": {"type": "DpathExtractor", "field_path": ["data"]}, + }, + "paginator": { + "type": "DefaultPaginator", + "page_token_option": { + "type": "RequestOption", + "inject_into": "request_parameter", + "field_name": "page_cursor", + }, + "pagination_strategy": { + "type": "CursorPagination", + "cursor_value": "{{ response.get('next_cursor') }}", + "stop_condition": "{{ not response.get('has_more', False) }}", + }, }, - "paginator": {"type": "NoPagination"}, "partition_router": { "type": "SubstreamPartitionRouter", "parent_stream_configs": [ @@ -543,10 +555,26 @@ def test_dynamic_streams_with_http_components_resolver_retriever_with_parent_str HttpRequest(url=f"https://api.test.com/parent/{parent_id}/items"), HttpResponse( body=json.dumps( - [ - {"id": 1, "name": "item_1"}, - {"id": 2, "name": "item_2"}, - ] + { + "data": [ + {"id": 1, "name": "item_1"}, + ], + "has_more": True, + "next_cursor": 1, + } + ) + ), + ) + http_mocker.get( + HttpRequest(url=f"https://api.test.com/parent/{parent_id}/items?page_cursor=1"), + HttpResponse( + body=json.dumps( + { + "data": [ + {"id": 2, "name": "item_2"}, + ], + "has_more": False, + } ) ), )