diff --git a/Makefile b/Makefile index 865691f59..0ab4b9562 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,7 @@ IMG ?= $(IMAGE_TAG_BASE):$(IMAGE_TAG) ENVTEST_K8S_VERSION = 1.22 # Directories containing unit & integration test packages -UNIT_DIRS := ./pkg/... ./api/... +UNIT_DIRS := ./pkg/... ./api/... ./controllers/... INTEGRATION_DIRS := ./controllers... # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) diff --git a/controllers/authpolicy_authconfig_test.go b/controllers/authpolicy_authconfig_test.go index 37784cd66..4d940f7f3 100644 --- a/controllers/authpolicy_authconfig_test.go +++ b/controllers/authpolicy_authconfig_test.go @@ -567,7 +567,7 @@ func TestAuthorinoConditionsFromHTTPRouteRule(t *testing.T) { { PatternExpressionOrRef: authorinoapi.PatternExpressionOrRef{ PatternExpression: authorinoapi.PatternExpression{ - Selector: `request.path.@extract:{"sep":"?x-foo=","pos":1}.@extract:{"sep":"&"}`, + Selector: `request.path.@extract:{"sep":"?x-foo=","pos":1}|@extract:{"sep":"&"}`, Operator: "eq", Value: "a-value", }, @@ -576,7 +576,7 @@ func TestAuthorinoConditionsFromHTTPRouteRule(t *testing.T) { { PatternExpressionOrRef: authorinoapi.PatternExpressionOrRef{ PatternExpression: authorinoapi.PatternExpression{ - Selector: `request.path.@extract:{"sep":"&x-foo=","pos":1}.@extract:{"sep":"&"}`, + Selector: `request.path.@extract:{"sep":"&x-foo=","pos":1}|@extract:{"sep":"&"}`, Operator: "eq", Value: "a-value", }, @@ -624,7 +624,7 @@ func TestAuthorinoConditionsFromHTTPRouteRule(t *testing.T) { { PatternExpressionOrRef: authorinoapi.PatternExpressionOrRef{ PatternExpression: authorinoapi.PatternExpression{ - Selector: `request.path.@extract:{"sep":"?x-foo=","pos":1}.@extract:{"sep":"&"}`, + Selector: `request.path.@extract:{"sep":"?x-foo=","pos":1}|@extract:{"sep":"&"}`, Operator: "eq", Value: "a-value", }, @@ -633,7 +633,7 @@ func TestAuthorinoConditionsFromHTTPRouteRule(t *testing.T) { { PatternExpressionOrRef: authorinoapi.PatternExpressionOrRef{ PatternExpression: authorinoapi.PatternExpression{ - Selector: `request.path.@extract:{"sep":"&x-foo=","pos":1}.@extract:{"sep":"&"}`, + Selector: `request.path.@extract:{"sep":"&x-foo=","pos":1}|@extract:{"sep":"&"}`, Operator: "eq", Value: "a-value", }, @@ -648,7 +648,7 @@ func TestAuthorinoConditionsFromHTTPRouteRule(t *testing.T) { { PatternExpressionOrRef: authorinoapi.PatternExpressionOrRef{ PatternExpression: authorinoapi.PatternExpression{ - Selector: `request.path.@extract:{"sep":"?x-bar=","pos":1}.@extract:{"sep":"&"}`, + Selector: `request.path.@extract:{"sep":"?x-bar=","pos":1}|@extract:{"sep":"&"}`, Operator: "eq", Value: "other-value", }, @@ -657,7 +657,7 @@ func TestAuthorinoConditionsFromHTTPRouteRule(t *testing.T) { { PatternExpressionOrRef: authorinoapi.PatternExpressionOrRef{ PatternExpression: authorinoapi.PatternExpression{ - Selector: `request.path.@extract:{"sep":"&x-bar=","pos":1}.@extract:{"sep":"&"}`, + Selector: `request.path.@extract:{"sep":"&x-bar=","pos":1}|@extract:{"sep":"&"}`, Operator: "eq", Value: "other-value", }, @@ -700,7 +700,7 @@ func TestAuthorinoConditionsFromHTTPRouteRule(t *testing.T) { { PatternExpressionOrRef: authorinoapi.PatternExpressionOrRef{ PatternExpression: authorinoapi.PatternExpression{ - Selector: `request.path.@extract:{"sep":"?x-foo=","pos":1}.@extract:{"sep":"&"}`, + Selector: `request.path.@extract:{"sep":"?x-foo=","pos":1}|@extract:{"sep":"&"}`, Operator: "matches", Value: "^a+.*$", }, @@ -709,7 +709,7 @@ func TestAuthorinoConditionsFromHTTPRouteRule(t *testing.T) { { PatternExpressionOrRef: authorinoapi.PatternExpressionOrRef{ PatternExpression: authorinoapi.PatternExpression{ - Selector: `request.path.@extract:{"sep":"&x-foo=","pos":1}.@extract:{"sep":"&"}`, + Selector: `request.path.@extract:{"sep":"&x-foo=","pos":1}|@extract:{"sep":"&"}`, Operator: "matches", Value: "^a+.*$", }, @@ -735,7 +735,7 @@ func TestAuthorinoConditionsFromHTTPRouteRule(t *testing.T) { } for i := range result { if !reflect.DeepEqual(result[i], tc.expected[i]) { - t.Errorf("Expected rule %d to be %v, got %v", i, tc.expected[i], result[i]) + t.Errorf("Expected rule %d to \nbe\t%v, \ngot\t%v", i, tc.expected[i], result[i]) } } })