mirror of
https://github.com/alibaba/higress.git
synced 2026-06-09 12:47:28 +08:00
upgrade to istio 1.19 (#1211)
Co-authored-by: CH3CHO <ch3cho@qq.com> Co-authored-by: rinfx <893383980@qq.com>
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
networking "istio.io/api/networking/v1alpha3"
|
||||
)
|
||||
|
||||
@@ -197,9 +198,9 @@ func TestRewriteApplyRoute(t *testing.T) {
|
||||
},
|
||||
},
|
||||
Rewrite: &networking.HTTPRewrite{
|
||||
UriRegex: &networking.RegexMatchAndSubstitute{
|
||||
Pattern: "/hello",
|
||||
Substitution: "/test",
|
||||
UriRegexRewrite: &networking.RegexRewrite{
|
||||
Match: "/hello",
|
||||
Rewrite: "/test",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -246,9 +247,9 @@ func TestRewriteApplyRoute(t *testing.T) {
|
||||
},
|
||||
},
|
||||
Rewrite: &networking.HTTPRewrite{
|
||||
UriRegex: &networking.RegexMatchAndSubstitute{
|
||||
Pattern: "/hello",
|
||||
Substitution: "/test",
|
||||
UriRegexRewrite: &networking.RegexRewrite{
|
||||
Match: "/hello",
|
||||
Rewrite: "/test",
|
||||
},
|
||||
Authority: "test.com",
|
||||
},
|
||||
@@ -331,7 +332,10 @@ func TestRewriteApplyRoute(t *testing.T) {
|
||||
},
|
||||
},
|
||||
Rewrite: &networking.HTTPRewrite{
|
||||
Uri: "/test/",
|
||||
UriRegexRewrite: &networking.RegexRewrite{
|
||||
Match: "^/hello(/.*)?",
|
||||
Rewrite: `/test\1`,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -363,9 +367,9 @@ func TestRewriteApplyRoute(t *testing.T) {
|
||||
},
|
||||
},
|
||||
Rewrite: &networking.HTTPRewrite{
|
||||
UriRegex: &networking.RegexMatchAndSubstitute{
|
||||
Pattern: "/exact",
|
||||
Substitution: "/test",
|
||||
UriRegexRewrite: &networking.RegexRewrite{
|
||||
Match: "/exact",
|
||||
Rewrite: "/test",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -398,9 +402,9 @@ func TestRewriteApplyRoute(t *testing.T) {
|
||||
},
|
||||
},
|
||||
Rewrite: &networking.HTTPRewrite{
|
||||
UriRegex: &networking.RegexMatchAndSubstitute{
|
||||
Pattern: "/prefix",
|
||||
Substitution: "/test",
|
||||
UriRegexRewrite: &networking.RegexRewrite{
|
||||
Match: "^/prefix",
|
||||
Rewrite: "/test",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -410,9 +414,7 @@ func TestRewriteApplyRoute(t *testing.T) {
|
||||
for _, inputCase := range inputCases {
|
||||
t.Run("", func(t *testing.T) {
|
||||
rewrite.ApplyRoute(inputCase.input, inputCase.config)
|
||||
if !reflect.DeepEqual(inputCase.input, inputCase.expect) {
|
||||
t.Fatal("Should be equal")
|
||||
}
|
||||
assert.Equal(t, inputCase.expect, inputCase.input)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user