nginx-gateway-fabric
nginx-gateway-fabric copied to clipboard
Simplify HTTP response assertions in tests
In our tests, we often inspect the response of an HTTP request.
Example 1 https://github.com/nginxinc/nginx-gateway-fabric/blob/2cd63e7e82729bdccda445f44db2f8eaec00ba38/tests/suite/graceful_recovery_test.go#L220
Example 2 https://github.com/nginxinc/nginx-gateway-fabric/blob/2cd63e7e82729bdccda445f44db2f8eaec00ba38/tests/scale/scale_test.go#L250
Gomega provides matches for HTTP response -- https://onsi.github.io/gomega/#working-with-http-responses
Acceptance criteria:
- Simplify response assertions by using Gomega specialized matchers.