You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnuserID, fmt.Errorf("someone stored a wrong value in the [%s] key with type [%T], expected [string]", keys.UserIDCtxKey, ctx.Value(keys.UserIDCtxKey))
assert.Error(t, err, "Expected an error when retrieving userID with the wrong type")
219
+
expectedErrorMsg:=fmt.Sprintf("someone stored a wrong value in the [%s] key with type [%T], expected [string]", keys.UserIDCtxKey, ctxWithWrongType.Value(keys.UserIDCtxKey))
220
+
assert.Equal(t, expectedErrorMsg, err.Error(), "Error message should match the expected message")
221
+
assert.Equal(t, "", retrievedUserID, "Retrieved userID should be an empty string when an error occurs")
222
+
}
223
+
224
+
funcTestHasUserIDInContext(t*testing.T) {
225
+
baseCtx:=context.Background()
226
+
227
+
assert.False(t, openmfpctx.HasUserIDInContext(baseCtx), "Expected false when userID is not set in context")
0 commit comments