File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
internal/mode/static/state/graph Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -710,3 +710,29 @@ func TestConvertGRPCMatches(t *testing.T) {
710
710
})
711
711
}
712
712
}
713
+
714
+ func TestConvertGRPCFilters (t * testing.T ) {
715
+ grFilters := []v1alpha2.GRPCRouteFilter {
716
+ {
717
+ Type : "RequestHeaderModifier" ,
718
+ RequestHeaderModifier : & v1.HTTPHeaderFilter {
719
+ Remove : []string {"header" },
720
+ },
721
+ },
722
+ {
723
+ Type : "RequestMirror" ,
724
+ },
725
+ }
726
+
727
+ expectedHTTPFilters := []v1.HTTPRouteFilter {
728
+ {
729
+ Type : v1 .HTTPRouteFilterRequestHeaderModifier ,
730
+ RequestHeaderModifier : grFilters [0 ].RequestHeaderModifier ,
731
+ },
732
+ }
733
+
734
+ g := NewWithT (t )
735
+
736
+ httpFilters := convertGRPCFilters (grFilters )
737
+ g .Expect (helpers .Diff (expectedHTTPFilters , httpFilters )).To (BeEmpty ())
738
+ }
You can’t perform that action at this time.
0 commit comments