Skip to content

Add Cloud Device API integration tests#1914

Merged
gcatanese merged 1 commit intomainfrom
add-cloud-device-integration-tests
Apr 17, 2026
Merged

Add Cloud Device API integration tests#1914
gcatanese merged 1 commit intomainfrom
add-cloud-device-integration-tests

Conversation

@gcatanese
Copy link
Copy Markdown
Contributor

Adds end-to-end integration tests for the Cloud Device API (sync, async, encrypted variants):

  • add CloudDeviceApiTerminalIT for sending requests to a terminal
  • add e2e-testing.md documenting how to configure and run the terminal tests
  • fix EncryptedCloudDeviceApi.async() to handle unencrypted error responses (e.g. terminal unreachable) the same way sync() does

@gcatanese gcatanese requested review from a team as code owners April 16, 2026 16:41
Copy link
Copy Markdown
Contributor

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

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 adds handling for unencrypted error responses in the EncryptedCloudDeviceApi and introduces a comprehensive integration testing suite. Feedback points out potential NullPointerException risks in the new logic, a missing mock file for async tests, and a thread-safety issue in the test property loader. Suggestions were also made to refactor duplicated test logic and replace console logging with a standard framework.

Comment thread src/test/java/com/adyen/BaseIntegrationTest.java
Comment thread src/test/java/com/adyen/service/clouddevice/CloudDeviceApiTerminalIT.java Outdated
cloudDeviceApi.sync(getMerchantAccount(), getTerminalDeviceId(), cloudDeviceApiRequest);

Assertions.assertNotNull(response);
System.out.println("Response: " + response);
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.

Hey @gcatanese, is there something that you check on the response output? Couldn't that be changed to assertions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

*/
public class CloudDeviceApiTerminalIT extends BaseIntegrationTest {

@Disabled("Enable when you want to test with the Terminal")
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is "special" integration test class, where tests need to be executed one by one (each test will wait for a response from the Terminal). It might be confusing, but it is the only way to test the integration with the POS terminal works.

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.

Sure, let's keep like this. If we have some idea in the future, we can address in a follow-up PR. I don't see it a blocker, so I'm leaving the approval.

@gcatanese gcatanese force-pushed the add-cloud-device-integration-tests branch from 3f315ea to ca3faf8 Compare April 17, 2026 11:48
@gcatanese gcatanese requested a review from jeandersonbc April 17, 2026 11:49
@gcatanese gcatanese enabled auto-merge April 17, 2026 11:53
@gcatanese gcatanese added this pull request to the merge queue Apr 17, 2026
Merged via the queue into main with commit f649126 Apr 17, 2026
5 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