Issues/82 add tests integration#83
Open
marek-ch wants to merge 21 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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 forApi.post(). - Adds real-server integration tests (skippable when
config.jsonis 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, solatch.countDown()is never reached. That can make the test hang until the await timeout and hide the real failure. Count down the latch before callingfail, or usetry/finallyto guaranteecountDown().
listener = object : IApiCallResponseListener<StatusResponse> {
override fun onSuccess(result: StatusResponse) {
fail("Request should have failed with wrong PIN but succeeded")
latch.countDown()
}
d9bf5c6 to
ed007b1
Compare
25589c8 to
c4ed3cb
Compare
3c0b349 to
a93e4f3
Compare
kober32
requested changes
May 15, 2026
Member
kober32
left a comment
There was a problem hiding this comment.
Pls add .github/workflows/tests.yaml workflow that will run these tests on the CI
829204f to
71ca07e
Compare
fc779c4 to
f1990ee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #82