diff --git a/testsuite/mockserver.py b/testsuite/mockserver.py index 212115a3..1ea03a7f 100644 --- a/testsuite/mockserver.py +++ b/testsuite/mockserver.py @@ -44,7 +44,7 @@ def create_request_expectation( } return self._expectation(expectation_id, json_data) - def create_expectation( + def create_response_expectation( self, expectation_id, body, diff --git a/testsuite/tests/kuadrant/authorino/authorization/opa/external_registry/conftest.py b/testsuite/tests/kuadrant/authorino/authorization/opa/external_registry/conftest.py index e2738c76..6c6269ec 100644 --- a/testsuite/tests/kuadrant/authorino/authorization/opa/external_registry/conftest.py +++ b/testsuite/tests/kuadrant/authorino/authorization/opa/external_registry/conftest.py @@ -15,7 +15,7 @@ def header(): def opa_policy_expectation(request, mockserver, module_label, header): """Creates Mockserver Expectation that returns Rego query and returns its endpoint""" request.addfinalizer(lambda: mockserver.clear_expectation(module_label)) - return mockserver.create_expectation(module_label, rego_allow_header(*header)) + return mockserver.create_response_expectation(module_label, rego_allow_header(*header)) @pytest.fixture(scope="module") diff --git a/testsuite/tests/kuadrant/authorino/authorization/opa/external_registry/test_auto_refresh_policy.py b/testsuite/tests/kuadrant/authorino/authorization/opa/external_registry/test_auto_refresh_policy.py index 35bd066c..b1b756d3 100644 --- a/testsuite/tests/kuadrant/authorino/authorization/opa/external_registry/test_auto_refresh_policy.py +++ b/testsuite/tests/kuadrant/authorino/authorization/opa/external_registry/test_auto_refresh_policy.py @@ -22,7 +22,7 @@ def updated_header(): @pytest.fixture(scope="module", autouse=True) def update_external_opa(mockserver, module_label, updated_header): """Updates Expectation with updated header""" - mockserver.create_expectation(module_label, rego_allow_header(*updated_header)) + mockserver.create_response_expectation(module_label, rego_allow_header(*updated_header)) # Sleeps for 1 second to compensate auto-refresh cycle `authorization.opa.externalRegistry.ttl = 1` time.sleep(1) diff --git a/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_metadata_condition.py b/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_metadata_condition.py index 0da4a71a..2927bacf 100644 --- a/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_metadata_condition.py +++ b/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_metadata_condition.py @@ -11,7 +11,7 @@ def mockserver_expectation(request, mockserver, module_label): """Creates Mockserver Expectation which returns non-empty response on hit""" request.addfinalizer(lambda: mockserver.clear_expectation(module_label)) - return mockserver.create_expectation(module_label, "response") + return mockserver.create_response_expectation(module_label, "response") @pytest.fixture(scope="module") diff --git a/testsuite/tests/kuadrant/authorino/dinosaur/conftest.py b/testsuite/tests/kuadrant/authorino/dinosaur/conftest.py index 431f4319..a45957e2 100644 --- a/testsuite/tests/kuadrant/authorino/dinosaur/conftest.py +++ b/testsuite/tests/kuadrant/authorino/dinosaur/conftest.py @@ -41,7 +41,7 @@ def terms_and_conditions(request, mockserver, module_label): """Creates Mockserver Expectation that returns whether terms are required and returns its endpoint""" def _terms_and_conditions(value): - return mockserver.create_expectation( + return mockserver.create_response_expectation( f"{module_label}-terms", {"terms_required": value}, ContentType.APPLICATION_JSON, @@ -56,7 +56,7 @@ def cluster_info(request, mockserver, module_label): """Creates Mockserver Expectation that returns client ID and returns its endpoint""" def _cluster_info(value): - return mockserver.create_expectation( + return mockserver.create_response_expectation( f"{module_label}-cluster", {"client_id": value}, ContentType.APPLICATION_JSON ) @@ -69,7 +69,7 @@ def resource_info(request, mockserver, module_label): """Creates Mockserver Expectation that returns info about resource and returns its endpoint""" def _resource_info(org_id, owner): - return mockserver.create_expectation( + return mockserver.create_response_expectation( f"{module_label}-resource", {"org_id": org_id, "owner": owner}, ContentType.APPLICATION_JSON, diff --git a/testsuite/tests/kuadrant/authorino/metadata/test_http.py b/testsuite/tests/kuadrant/authorino/metadata/test_http.py index 612f0128..72800489 100644 --- a/testsuite/tests/kuadrant/authorino/metadata/test_http.py +++ b/testsuite/tests/kuadrant/authorino/metadata/test_http.py @@ -26,7 +26,7 @@ def country_mock_expectation(request, mockserver, module_label): """Creates Mockserver Expectation which returns simple JSON that contains `allowed_countries`""" request.addfinalizer(lambda: mockserver.clear_expectation(module_label)) - return mockserver.create_expectation(module_label, ALLOWED_COUNTRY, ContentType.APPLICATION_JSON) + return mockserver.create_response_expectation(module_label, ALLOWED_COUNTRY, ContentType.APPLICATION_JSON) @pytest.fixture(scope="module") diff --git a/testsuite/tests/kuadrant/authorino/metadata/test_multi_element_json.py b/testsuite/tests/kuadrant/authorino/metadata/test_multi_element_json.py index 8492e797..116b7d21 100644 --- a/testsuite/tests/kuadrant/authorino/metadata/test_multi_element_json.py +++ b/testsuite/tests/kuadrant/authorino/metadata/test_multi_element_json.py @@ -16,7 +16,7 @@ def json_mock_expectation(request, mockserver, module_label): """Creates Mockserver Expectation which returns multi-element JSON.""" request.addfinalizer(lambda: mockserver.clear_expectation(module_label)) - return mockserver.create_expectation(module_label, MULTI_ELEMENT_JSON, ContentType.APPLICATION_JSON) + return mockserver.create_response_expectation(module_label, MULTI_ELEMENT_JSON, ContentType.APPLICATION_JSON) @pytest.fixture(scope="module") diff --git a/testsuite/tests/kuadrant/authorino/metrics/test_deep_metrics.py b/testsuite/tests/kuadrant/authorino/metrics/test_deep_metrics.py index 55c13462..1ec9abdf 100644 --- a/testsuite/tests/kuadrant/authorino/metrics/test_deep_metrics.py +++ b/testsuite/tests/kuadrant/authorino/metrics/test_deep_metrics.py @@ -11,7 +11,7 @@ def mockserver_expectation(request, mockserver, module_label): """Creates Mockserver Expectation which returns non-empty response on hit""" request.addfinalizer(lambda: mockserver.clear_expectation(module_label)) - return mockserver.create_expectation(module_label, "response") + return mockserver.create_response_expectation(module_label, "response") @pytest.fixture(scope="module")