Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/logger/sanitize/sanitize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ func TestMarshalAndSanitize(t *testing.T) {

t.Run("empty map marshals to empty JSON object", func(t *testing.T) {
result := MarshalAndSanitize(map[string]interface{}{})
assert.Equal(t, "{}", result)
assert.JSONEq(t, "{}", result)
})

t.Run("slice of strings with no secrets", func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/oidc/jwt_expiry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestExtractJWTExpiry_ValidToken_NoPaddingNeeded(t *testing.T) {
// payload raw length = 12, mod4 = 0 → no padding added
rawPayload := encodePayloadRaw(`{"exp":1}`)
assert.Len(t, rawPayload, 12)
assert.Equal(t, 0, len(rawPayload)%4)
assert.Zero(t, len(rawPayload)%4)

token := makeRawJWT(rawPayload)
got, err := extractJWTExpiry(token)
Expand Down
2 changes: 1 addition & 1 deletion internal/proxy/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ func TestPassthrough_Success(t *testing.T) {
assert.Equal(t, http.StatusCreated, w.Code)
assert.Contains(t, w.Body.String(), `"id":42`)
assert.Equal(t, http.MethodPost, receivedMethod)
assert.Equal(t, `{"title":"new issue"}`, receivedBody)
assert.JSONEq(t, `{"title":"new issue"}`, receivedBody)
}

func TestPassthrough_NilBody(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion internal/proxy/rate_limit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

// TestInjectRetryAfterIfRateLimited verifies Retry-After injection and logging for
Expand All @@ -29,7 +30,7 @@ func TestInjectRetryAfterIfRateLimited(t *testing.T) {
retryAfter := w.Header().Get("Retry-After")
assert.NotEmpty(t, retryAfter, "Retry-After should be set on 429")
secs, err := strconv.Atoi(retryAfter)
assert.NoError(t, err)
require.NoError(t, err)
assert.Greater(t, secs, 0, "Retry-After should be positive")
})

Expand Down
2 changes: 1 addition & 1 deletion internal/proxy/response_transform_coverage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestRewrapSearchResponse_ItemsKey(t *testing.T) {
m, ok := result.(map[string]interface{})
require.True(t, ok)
assert.Equal(t, float64(1), m["total_count"])
assert.Equal(t, false, m["incomplete_results"])
assert.False(t, m["incomplete_results"].(bool))
assert.Equal(t, filtered, m["items"])
}

Expand Down
2 changes: 1 addition & 1 deletion internal/server/http_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func TestWithResponseLogging_PreservesHeaders(t *testing.T) {
assert.Equal(t, "application/json", w.Header().Get("Content-Type"), "Content-Type header should be preserved")
assert.Equal(t, "test-value", w.Header().Get("X-Custom-Header"), "custom header should be preserved")
assert.Equal(t, http.StatusOK, w.Code, "status code should be preserved")
assert.Equal(t, `{"ok":true}`, w.Body.String(), "response body should be preserved")
assert.JSONEq(t, `{"ok":true}`, w.Body.String(), "response body should be preserved")
}

// TestWithResponseLogging_ReturnsHTTPHandler verifies the return type.
Expand Down
Loading