Skip to content

test(updateclihttp): add request header assertion and test cases#7815

Open
ak95asb wants to merge 3 commits intoupdatecli:mainfrom
ak95asb:fix/updateclihttp-source-test-check-headers
Open

test(updateclihttp): add request header assertion and test cases#7815
ak95asb wants to merge 3 commits intoupdatecli:mainfrom
ak95asb:fix/updateclihttp-source-test-check-headers

Conversation

@ak95asb
Copy link
Contributor

@ak95asb ak95asb commented Feb 23, 2026

Summary

Resolves the // TODO: check headers comment in source_test.go:140.

The mock's DoFunc now iterates over tt.spec.Request.Headers and
returns an error if any header on the outgoing request doesn't match
the spec — ensuring headers set via spec.request.headers are actually
forwarded on the wire.

Two new table-driven test cases added:

  • "Normal case with single request header" (Authorization)
  • "Normal case with multiple request headers" (Authorization + X-Custom-Header)

Test plan

  • go test ./pkg/plugins/resources/updateclihttp/... -run TestSource — all 8 cases pass

ak95asb and others added 2 commits February 23, 2026 17:05
Resolve a TODO at source_test.go to verify that custom HTTP request
headers specified via spec.request.headers are actually forwarded on
the wire. The mock's DoFunc now iterates over tt.spec.Request.Headers
and fails the test if the header value on the outgoing request does
not match the spec.

Two new table-driven test cases are added:
- "Normal case with single request header" (Authorization)
- "Normal case with multiple request headers" (Authorization + X-Custom-Header)
@ak95asb
Copy link
Contributor Author

ak95asb commented Feb 24, 2026

Hi @olblak, I am new to Go and open source development in general.
Please guide me on what I am supposed to do next. Or if I am just shooting in the dark here.
Thanks.

@ak95asb ak95asb closed this Feb 25, 2026
@olblak
Copy link
Member

olblak commented Feb 25, 2026

Hi @ak95asb,
You need to be patient :)

@olblak olblak reopened this Feb 25, 2026
@ak95asb
Copy link
Contributor Author

ak95asb commented Feb 25, 2026

Hi @olblak,
My bad. So sorry.
Thanks again for the hand holding.
:)

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