@@ -11,42 +11,10 @@ import (
11
11
12
12
func TestRouteName (t * testing.T ) {
13
13
t .Parallel ()
14
+ g := NewWithT (t )
14
15
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" ))
50
18
}
51
19
52
20
func TestPathWithBackendRef (t * testing.T ) {
@@ -65,7 +33,7 @@ func TestPathWithBackendRef(t *testing.T) {
65
33
Name : "service1" ,
66
34
Namespace : helpers.GetPointer [v1.Namespace ]("namespace1" ),
67
35
},
68
- expected : helpers .GetPointer ("/_ngf-internal-mirror-namespace1- service1-1" ),
36
+ expected : helpers .GetPointer ("/_ngf-internal-mirror-namespace1/ service1-1" ),
69
37
},
70
38
{
71
39
name : "without namespace" ,
@@ -103,7 +71,7 @@ func TestBackendPath(t *testing.T) {
103
71
idx : 1 ,
104
72
namespace : helpers .GetPointer ("namespace1" ),
105
73
service : "service1" ,
106
- expected : helpers .GetPointer ("/_ngf-internal-mirror-namespace1- service1-1" ),
74
+ expected : helpers .GetPointer ("/_ngf-internal-mirror-namespace1/ service1-1" ),
107
75
},
108
76
{
109
77
name : "Without namespace" ,
0 commit comments