Skip to content

fix: use hardcoded test credentials for custom OkHttpClient test#55

Open
itsmeadi wants to merge 1 commit intomainfrom
expose-http-client
Open

fix: use hardcoded test credentials for custom OkHttpClient test#55
itsmeadi wants to merge 1 commit intomainfrom
expose-http-client

Conversation

@itsmeadi
Copy link
Copy Markdown
Contributor

Summary

  • The testCustomOkHttpClientPreservesConfig test was using System.getenv() to read API credentials, but in the Gradle test JVM credentials are injected as system properties (from local.properties), not environment variables. This caused a NullPointerException in buildJWT() when apiSecret was null.
  • Replaced System.getenv("STREAM_API_KEY") / System.getenv("STREAM_API_SECRET") with hardcoded test credentials so the test works reliably regardless of how credentials are provided.

Test plan

  • ./gradlew test --tests "io.getstream.StreamHTTPClientTest" passes (all 8 tests)
  • ./gradlew spotlessCheck passes

Made with Cursor

The test was using System.getenv() to read API credentials directly, but
the Gradle test JVM receives credentials as system properties (from
local.properties), not environment variables. Reuse the already-
initialized client's credentials, consistent with other tests.

Made-with: Cursor
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