Skip to content

Commit bc10ab0

Browse files
committed
test: assert default-field KeyCredential toString keeps the headerName
The default-fields redaction test only asserted the secret was masked. Add an assertion that the non-secret headerName (Authorization) is still rendered, so the test pins both halves of the contract like the explicit-fields test does.
1 parent 5a951a2 commit bc10ab0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

sdk-core/src/test/kotlin/org/dexpace/sdk/core/http/auth/CredentialTest.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ class CredentialTest {
7676
val rendered = cred.toString()
7777
assertFalse(rendered.contains("another-secret"), "toString must not contain the raw apiKey")
7878
assertTrue(rendered.contains("apiKey=***"), "toString must redact the apiKey")
79+
assertTrue(
80+
rendered.contains(HttpHeaderName.AUTHORIZATION.toString()),
81+
"toString should keep the default headerName for diagnostics",
82+
)
7983
}
8084

8185
// ----------------- NamedKeyCredential -----------------

0 commit comments

Comments
 (0)