Skip to content

test: add baseUrl validation tests to all service test files#488

Open
gourabsingha1 wants to merge 3 commits into
Adyen:mainfrom
gourabsingha1:feat/add-baseurl-tests-to-services
Open

test: add baseUrl validation tests to all service test files#488
gourabsingha1 wants to merge 3 commits into
Adyen:mainfrom
gourabsingha1:feat/add-baseurl-tests-to-services

Conversation

@gourabsingha1

Copy link
Copy Markdown

Description

This PR addresses issue #475 by adding baseUrl environment validation tests (test_base_url_test_environment, test_base_url_live_environment, and test_base_url_live_environment_no_prefix_raises where applicable) directly into each of the individual service test files.

Previously, baseUrl resolution checks were centralized in DetermineEndpointTest.py or only tested on specific services like RecurringTest.py. With this update, each service test class is self-contained and independently validates that its corresponding service builds/resolves base API URLs correctly for different environment configurations (Test vs. Live platforms).

Approach

Added the standard set of base URL validation tests at the end of the following service test suites:

  • BalancePlatformTest.py
  • BinLookupTest.py
  • CapitalTest.py
  • CheckoutTest.py
  • CheckoutUtilityTest.py
  • DataProtectionTest.py
  • DisputesTest.py
  • LegalEntityManagementTest.py
  • ManagementTest.py
  • PaymentTest.py
  • PosMobileTest.py
  • SessionAuthenticationTest.py
  • StoredValueTest.py
  • TerminalTest.py
  • ThirdPartyPayoutTest.py
  • TransfersTest.py

Testing

Ran the entire test suite:

python3 -m unittest discover -s test -p "*Test.py"

Verified that all 215 tests pass successfully.

@gourabsingha1 gourabsingha1 requested a review from a team as a code owner June 22, 2026 17:32

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces unit tests across various test suites to verify API URL determination for both test and live environments, including error handling when the live endpoint prefix is missing. The feedback highlights a potential issue where tests mutate the shared live_endpoint_prefix state without proper cleanup on assertion failures. It is recommended to wrap these test blocks in try...finally structures to prevent state leakage and ensure test isolation.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread test/BinLookupTest.py Outdated
Comment thread test/CheckoutTest.py Outdated
Comment thread test/PaymentTest.py Outdated
Comment thread test/PosMobileTest.py Outdated
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant