Skip to content

[SNOW-3249917] Port 25 missing JDBC unit tests for replicated classes - #1147

Merged
sfc-gh-ggeng merged 2 commits into
masterfrom
jdbc-removal-port-missing-tests
Apr 14, 2026
Merged

sfc-gh-ggeng merged 2 commits into
masterfrom
jdbc-removal-port-missing-tests

Conversation

@sfc-gh-ggeng

Copy link
Copy Markdown
Collaborator

Summary

Port unit tests from snowflake-jdbc v3.25.1 for all 25 replicated classes that had JDBC tests but were missing ingest tests. All converted from JUnit 5 to JUnit 4 to match project test infrastructure.

25 files added, +3514 lines

Security & Crypto (3)

  • SecretDetectorTest — secret masking (SAS tokens, passwords, credentials)
  • EncryptionProviderTest — AES-CBC encrypt/decrypt round-trip
  • GcmEncryptionProviderTest — AES-GCM encrypt/decrypt round-trip

HTTP Infrastructure (5)

  • RestRequestTest — HTTP retry/backoff logic
  • JdbcHttpUtilTest — HTTP client build race condition
  • AttributeEnhancingHttpRequestRetryHandlerTest — retry handler attributes
  • HeaderCustomizerHttpRequestInterceptorTest — HTTP header customization
  • URLUtilTest — URL validation and request ID extraction

Storage Clients (4)

  • AwsSdkGCPSignerTest — GCS signer header mapping
  • SnowflakeAzureClientTest — Azure error info formatting
  • SnowflakeS3ClientTest — S3 domain suffix
  • StageInfoGcsCustomEndpointTest — GCS custom endpoint parameterized

Core (5)

  • FileCacheManagerTest — OCSP cache file permissions (26 tests, 1 @ignore)
  • ObjectMapperFactoryTest — ObjectMapper max string length
  • ExecTimeTelemetryDataTest — execution time telemetry generation
  • SnowflakeFileTransferConfigTest — config builder pattern
  • SnowflakeConnectStringTest — connection string account parsing

Logging (5)

  • EventHandlerTest — event publish/flush
  • EventTest — event type/dump
  • SFFormatterTest — UTC timestamp formatting
  • SFLoggerFactoryTest — default logger creation
  • JDK14LoggerTest — @ignore (same as JDBC)

Telemetry (3)

  • TelemetryServiceOOBTest — OOB telemetry enable/disable/connection string
  • TelemetryThreadPoolTest — thread pool scaling
  • TelemetryJsonTest — JSON conversion

Notes

  • 1 test @Ignored: FileCacheManagerTest.throwWhenOverrideCacheFileHasDifferentOwnerThanCurrentUserTest requires mockito-inline for Mockito.mockStatic(); project uses mockito-core + PowerMock
  • SFSessionProperty.ACCOUNT not replicated in ingest (only proxy properties); replaced with string constant "ACCOUNT" in SnowflakeConnectStringTest

Stacked on #1146.

Test plan

  • mvn test-compile passes
  • All 25 test files run: 132 tests, 131 pass, 1 skipped (@ignore)
  • ./format.sh passes
  • CI passes

🤖 Generated with Claude Code

@sfc-gh-ggeng
sfc-gh-ggeng requested review from a team as code owners April 7, 2026 19:23
@sfc-gh-ggeng
sfc-gh-ggeng force-pushed the jdbc-removal-port-missing-tests branch from 2826354 to 2631868 Compare April 7, 2026 21:29
@sfc-gh-ggeng
sfc-gh-ggeng force-pushed the jdbc-removal-step11d-demote-jdbc-v2 branch 2 times, most recently from 6cba4fd to cf20935 Compare April 7, 2026 23:15
@sfc-gh-ggeng
sfc-gh-ggeng force-pushed the jdbc-removal-port-missing-tests branch from 2631868 to b2c074b Compare April 7, 2026 23:15
@sfc-gh-ggeng
sfc-gh-ggeng force-pushed the jdbc-removal-step11d-demote-jdbc-v2 branch from cf20935 to 6b3b7a5 Compare April 8, 2026 02:32
@sfc-gh-ggeng
sfc-gh-ggeng force-pushed the jdbc-removal-port-missing-tests branch 2 times, most recently from 217d987 to 1919bab Compare April 8, 2026 05:35
Base automatically changed from jdbc-removal-step11d-demote-jdbc-v2 to master April 8, 2026 17:49
Port unit tests from snowflake-jdbc v3.25.1 for all replicated classes
that had JDBC tests but were missing ingest tests. All converted from
JUnit 5 to JUnit 4 to match project test infrastructure.

Tests ported:
- Security: SecretDetectorTest (masking), EncryptionProviderTest (CBC),
  GcmEncryptionProviderTest (GCM)
- HTTP: RestRequestTest (retry/backoff), JdbcHttpUtilTest (client build),
  AttributeEnhancingHttpRequestRetryHandlerTest,
  HeaderCustomizerHttpRequestInterceptorTest, URLUtilTest
- Storage: AwsSdkGCPSignerTest, SnowflakeAzureClientTest,
  SnowflakeS3ClientTest, StageInfoGcsCustomEndpointTest
- Core: FileCacheManagerTest, ObjectMapperFactoryTest,
  ExecTimeTelemetryDataTest, SnowflakeFileTransferConfigTest,
  SnowflakeConnectStringTest
- Logging: EventHandlerTest, EventTest, SFFormatterTest,
  SFLoggerFactoryTest, JDK14LoggerTest (@ignore)
- Telemetry: TelemetryServiceOOBTest, TelemetryThreadPoolTest,
  TelemetryJsonTest

1 test @ignore'd: FileCacheManagerTest.throwWhenOverrideCacheFile...
(requires mockito-inline for Mockito.mockStatic; project uses PowerMock)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sfc-gh-ggeng
sfc-gh-ggeng force-pushed the jdbc-removal-port-missing-tests branch from 1919bab to 9924edf Compare April 8, 2026 17:50
- Add hamcrest-core:1.3 as explicit test dependency (used by ported
  tests: RestRequestTest, JdbcHttpUtilTest, SnowflakeConnectStringTest,
  SecretDetectorTest)
- Exclude vulnerable transitive deps from snowflake-jdbc-thin in both
  main pom and e2e-jar-test pom:
  - grpc-netty-shaded (CVE-2025-55163, CVSS 8.7)
  - commons-lang3 (CVE-2025-48924, CVSS 8.8)
  - javax.servlet-api (license: CDDL-1.1/GPL-2.0)
  - javax.annotation-api (license: CDDL-1.1/GPL-2.0)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sfc-gh-ggeng
sfc-gh-ggeng merged commit 8ec7c2b into master Apr 14, 2026
92 of 99 checks passed
@sfc-gh-ggeng
sfc-gh-ggeng deleted the jdbc-removal-port-missing-tests branch April 14, 2026 00:30
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.

2 participants