@@ -11,42 +11,10 @@ import (
1111
1212func TestRouteName (t * testing.T ) {
1313 t .Parallel ()
14+ g := NewWithT (t )
1415
15- tests := []struct {
16- namespace * string
17- name string
18- routeName string
19- service string
20- expected string
21- idx int
22- }{
23- {
24- name : "with namespace" ,
25- routeName : "route1" ,
26- service : "service1" ,
27- namespace : helpers .GetPointer ("namespace1" ),
28- idx : 1 ,
29- expected : "_ngf-internal-mirror-route1-service1-namespace1-1" ,
30- },
31- {
32- name : "without namespace" ,
33- routeName : "route2" ,
34- service : "service2" ,
35- namespace : nil ,
36- idx : 2 ,
37- expected : "_ngf-internal-mirror-route2-service2-2" ,
38- },
39- }
40-
41- for _ , tt := range tests {
42- t .Run (tt .name , func (t * testing.T ) {
43- t .Parallel ()
44- g := NewWithT (t )
45-
46- result := RouteName (tt .routeName , tt .service , tt .namespace , tt .idx )
47- g .Expect (result ).To (Equal (tt .expected ))
48- })
49- }
16+ result := RouteName ("route1" , "service1" , "namespace1" , 1 )
17+ g .Expect (result ).To (Equal ("_ngf-internal-mirror-route1-namespace1/service1-1" ))
5018}
5119
5220func TestPathWithBackendRef (t * testing.T ) {
@@ -65,7 +33,7 @@ func TestPathWithBackendRef(t *testing.T) {
6533 Name : "service1" ,
6634 Namespace : helpers.GetPointer [v1.Namespace ]("namespace1" ),
6735 },
68- expected : helpers .GetPointer ("/_ngf-internal-mirror-namespace1- service1-1" ),
36+ expected : helpers .GetPointer ("/_ngf-internal-mirror-namespace1/ service1-1" ),
6937 },
7038 {
7139 name : "without namespace" ,
@@ -103,7 +71,7 @@ func TestBackendPath(t *testing.T) {
10371 idx : 1 ,
10472 namespace : helpers .GetPointer ("namespace1" ),
10573 service : "service1" ,
106- expected : helpers .GetPointer ("/_ngf-internal-mirror-namespace1- service1-1" ),
74+ expected : helpers .GetPointer ("/_ngf-internal-mirror-namespace1/ service1-1" ),
10775 },
10876 {
10977 name : "Without namespace" ,
0 commit comments