Skip to content

Commit a2a6a0a

Browse files
committed
added assertions for JWT token
1 parent b4596fc commit a2a6a0a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

client-v2/src/test/java/com/clickhouse/client/HttpTransportTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858

5959
import static com.github.tomakehurst.wiremock.stubbing.Scenario.STARTED;
6060
import static org.junit.Assert.assertEquals;
61+
import static org.junit.Assert.assertNotNull;
6162
import static org.junit.Assert.assertThrows;
6263
import static org.junit.Assert.fail;
6364

@@ -1014,6 +1015,8 @@ public void testJWTWithCloud() throws Exception {
10141015
return; // only for cloud
10151016
}
10161017
String jwt = System.getenv("INTEGRATIONS_TEAM_TESTS_CLOUD_JWT_DESERT_VM_43");
1018+
Assert.assertTrue(jwt != null && !jwt.trim().isEmpty(), "JWT is missing");
1019+
Assert.assertFalse(jwt.contains("\n") || jwt.contains("-----"), "JWT should be single string ready for HTTP header");
10171020
try (Client client = newClient().useBearerTokenAuth(jwt).build()) {
10181021
try {
10191022
List<GenericRecord> response = client.queryAll("SELECT user(), now()");

0 commit comments

Comments
 (0)