Skip to content

Commit c33eb1b

Browse files
pavelzemanclaude
andcommitted
test: add unit tests for header validation fixes
Add standalone test-runner with 7 tests covering both interceptor fixes: CompressedResponseSizeInterceptor (AZ02): - brokenInterceptor_failsWithArabicLocale: proves locale-dependent formatting crashes - fixedInterceptor_succeedsWithArabicLocale: proves Locale.US fix works - fixedInterceptor_succeedsWithUSLocale: regression test BearerTokenInterceptor (AYPW): - brokenInterceptor_failsWithControlCharInToken: proves corrupt tokens crash - fixedInterceptor_succeedsWithControlCharInToken: proves sanitization works - fixedInterceptor_skipsHeaderWhenTokenIsAllControlChars: edge case - fixedInterceptor_passesCleanTokenUnmodified: regression test Run with: cd test-runner && ./gradlew test Co-authored-by: Claude <claude@anthropic.com>
1 parent c76940e commit c33eb1b

8 files changed

Lines changed: 693 additions & 0 deletions

File tree

test-runner/build.gradle.kts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
plugins {
2+
kotlin("jvm") version "1.9.22"
3+
}
4+
5+
repositories {
6+
mavenCentral()
7+
}
8+
9+
dependencies {
10+
implementation("com.squareup.okhttp3:okhttp:4.12.0")
11+
testImplementation("junit:junit:4.13.2")
12+
testImplementation("com.squareup.okhttp3:mockwebserver:4.12.0")
13+
}
14+
15+
sourceSets {
16+
test {
17+
kotlin {
18+
srcDir("src/test/kotlin")
19+
}
20+
}
21+
}
42.4 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

test-runner/gradlew

Lines changed: 249 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-runner/gradlew.bat

Lines changed: 92 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-runner/settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = "interceptor-tests"

0 commit comments

Comments
 (0)