Skip to content

Issues/82 add tests integration#83

Open
marek-ch wants to merge 21 commits into
developfrom
issues/82-add-tests-integration
Open

Issues/82 add tests integration#83
marek-ch wants to merge 21 commits into
developfrom
issues/82-add-tests-integration

Conversation

@marek-ch
Copy link
Copy Markdown
Contributor

Closes #82

Copilot AI review requested due to automatic review settings May 13, 2026 13:45
@marek-ch marek-ch self-assigned this May 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Android instrumentation (androidTest) coverage for the Api.post() pipeline in Wultra PowerAuth Networking, including offline tests via MockWebServer and optional real-server integration tests configured via androidTest assets.

Changes:

  • Adds MockWebServer-based instrumentation tests validating request construction (headers/body/path) and response/error handling for Api.post().
  • Adds real-server integration tests (skippable when config.json is absent) to exercise E2EE, signed, and token-signed endpoint flows against a PowerAuth/Enrollment/Operations backend.
  • Introduces androidTest support utilities (IntegrationTestApi, endpoint definitions, config loader, activation lifecycle proxy) and documents required asset configuration.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
library/src/androidTest/java/com/wultra/android/powerauth/networking/support/TestEndpoints.kt Adds test endpoint definitions and request model for onboarding start.
library/src/androidTest/java/com/wultra/android/powerauth/networking/support/TestConfiguration.kt Adds config.json loader for server-dependent tests.
library/src/androidTest/java/com/wultra/android/powerauth/networking/support/PowerAuthIntegrationProxy.kt Adds helper for creating dummy PowerAuthSDK and managing real-server activation lifecycle.
library/src/androidTest/java/com/wultra/android/powerauth/networking/support/IntegrationTestApi.kt Adds concrete Api subclass for tests.
library/src/androidTest/java/com/wultra/android/powerauth/networking/PostRealServerTest.kt Adds real-server instrumentation tests for plain/E2EE/signed/token-signed flows.
library/src/androidTest/java/com/wultra/android/powerauth/networking/PostMockWebServerTest.kt Adds offline MockWebServer instrumentation tests for Api.post() behaviors.
library/src/androidTest/assets/README.md Documents how to provide integration test configuration via assets.
library/src/androidTest/assets/config-example.json Provides an example config template for real-server tests.
Comments suppressed due to low confidence (1)

library/src/androidTest/java/com/wultra/android/powerauth/networking/PostRealServerTest.kt:335

  • In this callback, fail(...) throws immediately, so latch.countDown() is never reached. That can make the test hang until the await timeout and hide the real failure. Count down the latch before calling fail, or use try/finally to guarantee countDown().
                listener = object : IApiCallResponseListener<StatusResponse> {
                    override fun onSuccess(result: StatusResponse) {
                        fail("Request should have failed with wrong PIN but succeeded")
                        latch.countDown()
                    }

Comment thread library/src/androidTest/assets/README.md
@marek-ch marek-ch force-pushed the issues/82-add-tests-integration branch from d9bf5c6 to ed007b1 Compare May 13, 2026 15:22
@marek-ch marek-ch force-pushed the issues/82-add-tests-integration branch from 25589c8 to c4ed3cb Compare May 14, 2026 09:06
@marek-ch marek-ch force-pushed the issues/82-add-tests-integration branch from 3c0b349 to a93e4f3 Compare May 14, 2026 09:15

This comment was marked as resolved.

Copy link
Copy Markdown
Member

@kober32 kober32 left a comment

Choose a reason for hiding this comment

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

Pls add .github/workflows/tests.yaml workflow that will run these tests on the CI

Comment thread library/src/androidTest/assets/README.md Outdated
@marek-ch marek-ch force-pushed the issues/82-add-tests-integration branch from 829204f to 71ca07e Compare May 15, 2026 13:41
@marek-ch marek-ch force-pushed the issues/82-add-tests-integration branch from fc779c4 to f1990ee Compare May 15, 2026 14:25
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.

Add tests - integration

3 participants