Skip to content

Conversation

@davidjumani
Copy link
Contributor

Description

This is a followup to #12999 (review) && #12926 (comment)
It refactors the injection code and adds tests

Change Type

Select one or more of the following by including the corresponding slash-command:

/kind cleanup

Changelog

NONE

@gateway-bot gateway-bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none labels Dec 10, 2025
processGatewayCollectionOptions(&cfg)

assert.NotNil(t, cfg.listenerIndex)
assert.NotNil(t, cfg.transformationFunc)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK go can't test the equivalence of functions (test whether cfg.transformationFunc is the same as GatewayTransformationFunc, the default value), so the second best is to ensure it is not nil

Signed-off-by: David Jumani <[email protected]>
Signed-off-by: David Jumani <[email protected]>
@davidjumani davidjumani changed the title Refactor and add tests for injecitons Refactor and add tests for injections Dec 10, 2025
Copy link
Contributor

@josh-pritchard josh-pritchard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants