Skip to content

Commit 713fb10

Browse files
Dakshclaude
andcommitted
Use STREAM_MULTI_TENANT_KEY/SECRET for team usage stats tests
- Rename env vars from STREAM_USAGE_STATS_* to STREAM_MULTI_TENANT_* - Remove fallback to STREAM_KEY/STREAM_SECRET - Fail explicitly with clear error message when credentials are missing Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b1c9186 commit 713fb10

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

src/test/java/io/getstream/chat/java/TeamUsageStatsIntegrationTest.java

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,22 @@
1313
import org.junit.jupiter.api.Test;
1414

1515
/**
16-
* Integration tests for Team Usage Stats API. Uses dedicated test credentials from
17-
* STREAM_USAGE_STATS_KEY and STREAM_USAGE_STATS_SECRET environment variables.
16+
* Integration tests for Team Usage Stats API. Uses dedicated multi-tenant test app credentials from
17+
* STREAM_MULTI_TENANT_KEY and STREAM_MULTI_TENANT_SECRET environment variables.
1818
*
1919
* <p>These tests verify that the SDK correctly parses all response data from the backend.
2020
*/
2121
public class TeamUsageStatsIntegrationTest {
2222

2323
@BeforeAll
2424
static void setup() {
25-
// Use dedicated credentials for usage stats testing
26-
String apiKey = System.getenv("STREAM_USAGE_STATS_KEY");
27-
String apiSecret = System.getenv("STREAM_USAGE_STATS_SECRET");
25+
String apiKey = System.getenv("STREAM_MULTI_TENANT_KEY");
26+
String apiSecret = System.getenv("STREAM_MULTI_TENANT_SECRET");
2827

29-
// Fall back to standard credentials if usage stats specific ones aren't set
30-
if (apiKey == null || apiKey.isEmpty()) {
31-
apiKey = System.getenv("STREAM_KEY");
32-
}
33-
if (apiSecret == null || apiSecret.isEmpty()) {
34-
apiSecret = System.getenv("STREAM_SECRET");
35-
}
36-
37-
if (apiKey == null || apiSecret == null) {
28+
if (apiKey == null || apiKey.isEmpty() || apiSecret == null || apiSecret.isEmpty()) {
3829
throw new IllegalStateException(
39-
"Missing credentials. Set STREAM_USAGE_STATS_KEY/STREAM_USAGE_STATS_SECRET or"
40-
+ " STREAM_KEY/STREAM_SECRET");
30+
"Multi-tenant test app credentials are missing. "
31+
+ "Set STREAM_MULTI_TENANT_KEY and STREAM_MULTI_TENANT_SECRET environment variables.");
4132
}
4233

4334
Properties props = new Properties();

0 commit comments

Comments
 (0)