Skip to content

Unit test for checkout (PR- 2015) and payment (PR2021) - #2054

Merged
poojah-adyen merged 1 commit into
mainfrom
test-case-checkout-payment
Aug 26, 2026
Merged

Unit test for checkout (PR- 2015) and payment (PR2021)#2054
poojah-adyen merged 1 commit into
mainfrom
test-case-checkout-payment

Conversation

@poojah-adyen

Copy link
Copy Markdown
Contributor

Description

Tested scenarios

Fixed issue:

@poojah-adyen
poojah-adyen requested a review from a team as a code owner August 26, 2026 14:29

@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 several unit tests to verify session updates, serialization and deserialization of new checkout model fields (including AffirmDetails, DonationCampaignsRequest, DonationPaymentMethod, and Gopay Wallet), and transaction link ID serialization. The feedback suggests making the JSON serialization assertion in TestTransactionLinkId more robust by checking for substring containment rather than exact string equality, which can be fragile.

Comment on lines +517 to +518
assertEquals(
"{\"transactionLinkId\":\"MC-TLID-123456789\"}", requestAdditionalData.toJson());

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.

medium

Directly asserting the exact JSON string equality can be fragile and prone to failure if formatting, field order, or default serialization settings change in the future. Since contains is already used elsewhere in the codebase for simple JSON checks, consider using assertTrue with contains to make the assertion more robust.

    assertTrue(requestAdditionalData.toJson().contains("\"transactionLinkId\":\"" + transactionLinkId + "\""));

@poojah-adyen
poojah-adyen force-pushed the test-case-checkout-payment branch from 58c3847 to 3df40ff Compare August 26, 2026 14:36
@poojah-adyen
poojah-adyen enabled auto-merge August 26, 2026 14:36
@sonarqubecloud

Copy link
Copy Markdown

@poojah-adyen
poojah-adyen added this pull request to the merge queue Aug 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Aug 26, 2026
@poojah-adyen
poojah-adyen added this pull request to the merge queue Aug 26, 2026
Merged via the queue into main with commit db3374f Aug 26, 2026
8 checks passed
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.

2 participants