Skip to content

Commit 211e59a

Browse files
committed
Change to lowercase urlRewrite in tests
1 parent 7116b06 commit 211e59a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

internal/mode/static/state/graph/httproute_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,20 +1016,20 @@ func TestValidateFilterRedirect(t *testing.T) {
10161016

10171017
func TestValidateFilterRewrite(t *testing.T) {
10181018
tests := []struct {
1019-
URLRewrite *gatewayv1.HTTPURLRewriteFilter
1019+
urlRewrite *gatewayv1.HTTPURLRewriteFilter
10201020
validator *validationfakes.FakeHTTPFieldsValidator
10211021
name string
10221022
expectErrCount int
10231023
}{
10241024
{
10251025
validator: &validationfakes.FakeHTTPFieldsValidator{},
1026-
URLRewrite: nil,
1026+
urlRewrite: nil,
10271027
name: "nil filter",
10281028
expectErrCount: 1,
10291029
},
10301030
{
10311031
validator: &validationfakes.FakeHTTPFieldsValidator{},
1032-
URLRewrite: &gatewayv1.HTTPURLRewriteFilter{
1032+
urlRewrite: &gatewayv1.HTTPURLRewriteFilter{
10331033
Hostname: helpers.GetPointer[gatewayv1.PreciseHostname]("example.com"),
10341034
Path: &gatewayv1.HTTPPathModifier{
10351035
Type: gatewayv1.FullPathHTTPPathModifier,
@@ -1041,7 +1041,7 @@ func TestValidateFilterRewrite(t *testing.T) {
10411041
},
10421042
{
10431043
validator: &validationfakes.FakeHTTPFieldsValidator{},
1044-
URLRewrite: &gatewayv1.HTTPURLRewriteFilter{},
1044+
urlRewrite: &gatewayv1.HTTPURLRewriteFilter{},
10451045
expectErrCount: 0,
10461046
name: "valid rewrite filter with no fields set",
10471047
},
@@ -1051,7 +1051,7 @@ func TestValidateFilterRewrite(t *testing.T) {
10511051
validator.ValidateHostnameReturns(errors.New("invalid hostname"))
10521052
return validator
10531053
}(),
1054-
URLRewrite: &gatewayv1.HTTPURLRewriteFilter{
1054+
urlRewrite: &gatewayv1.HTTPURLRewriteFilter{
10551055
Hostname: helpers.GetPointer[gatewayv1.PreciseHostname](
10561056
"example.com",
10571057
), // any value is invalid by the validator
@@ -1061,7 +1061,7 @@ func TestValidateFilterRewrite(t *testing.T) {
10611061
},
10621062
{
10631063
validator: &validationfakes.FakeHTTPFieldsValidator{},
1064-
URLRewrite: &gatewayv1.HTTPURLRewriteFilter{
1064+
urlRewrite: &gatewayv1.HTTPURLRewriteFilter{
10651065
Path: &gatewayv1.HTTPPathModifier{
10661066
Type: "bad-type",
10671067
},
@@ -1075,7 +1075,7 @@ func TestValidateFilterRewrite(t *testing.T) {
10751075
validator.ValidateRewritePathReturns(errors.New("invalid path value"))
10761076
return validator
10771077
}(),
1078-
URLRewrite: &gatewayv1.HTTPURLRewriteFilter{
1078+
urlRewrite: &gatewayv1.HTTPURLRewriteFilter{
10791079
Path: &gatewayv1.HTTPPathModifier{
10801080
Type: gatewayv1.FullPathHTTPPathModifier,
10811081
ReplaceFullPath: helpers.GetPointer("/path"),
@@ -1090,7 +1090,7 @@ func TestValidateFilterRewrite(t *testing.T) {
10901090
validator.ValidateRewritePathReturns(errors.New("invalid path"))
10911091
return validator
10921092
}(),
1093-
URLRewrite: &gatewayv1.HTTPURLRewriteFilter{
1093+
urlRewrite: &gatewayv1.HTTPURLRewriteFilter{
10941094
Path: &gatewayv1.HTTPPathModifier{
10951095
Type: gatewayv1.PrefixMatchHTTPPathModifier,
10961096
ReplacePrefixMatch: helpers.GetPointer("/path"),
@@ -1106,7 +1106,7 @@ func TestValidateFilterRewrite(t *testing.T) {
11061106
validator.ValidateRewritePathReturns(errors.New("invalid path"))
11071107
return validator
11081108
}(),
1109-
URLRewrite: &gatewayv1.HTTPURLRewriteFilter{
1109+
urlRewrite: &gatewayv1.HTTPURLRewriteFilter{
11101110
Hostname: helpers.GetPointer[gatewayv1.PreciseHostname](
11111111
"example.com",
11121112
), // any value is invalid by the validator
@@ -1125,7 +1125,7 @@ func TestValidateFilterRewrite(t *testing.T) {
11251125
for _, test := range tests {
11261126
t.Run(test.name, func(t *testing.T) {
11271127
g := NewWithT(t)
1128-
allErrs := validateFilterRewrite(test.validator, test.URLRewrite, filterPath)
1128+
allErrs := validateFilterRewrite(test.validator, test.urlRewrite, filterPath)
11291129
g.Expect(allErrs).To(HaveLen(test.expectErrCount))
11301130
})
11311131
}

0 commit comments

Comments
 (0)