@@ -52,9 +52,9 @@ func TestBasic(t *testing.T) {
5252 }
5353
5454 // Waypoint service has not been processed.
55- assert .Equal (t , len (cache .serviceToWaypoint ), 1 )
56- assert .Equal (t , len (cache .workloadToWaypoint ), 1 )
57- assert .Equal (t , len (cache .waypointAssociatedObjects ), 1 )
55+ assert .Equal (t , 1 , len (cache .serviceToWaypoint ))
56+ assert .Equal (t , 1 , len (cache .workloadToWaypoint ))
57+ assert .Equal (t , 1 , len (cache .waypointAssociatedObjects ))
5858
5959 if _ , ok := cache .serviceToWaypoint [svc3 .ResourceName ()]; ! ok {
6060 t .Fatalf ("service %s should be included in waypoint cache" , svc3 .ResourceName ())
@@ -67,23 +67,23 @@ func TestBasic(t *testing.T) {
6767 }
6868
6969 associated := cache .waypointAssociatedObjects [waypointHostname ]
70- assert .Equal (t , associated .isResolved (), false )
70+ assert .Equal (t , false , associated .isResolved ())
7171
7272 isHostnameTypeWaypoint := func (waypoint * workloadapi.GatewayAddress ) bool {
7373 return waypoint .GetHostname () != nil
7474 }
7575
76- assert .Equal (t , isHostnameTypeWaypoint (associated .services [svc3 .ResourceName ()].Waypoint ), true )
77- assert .Equal (t , isHostnameTypeWaypoint (associated .workloads [wl3 .ResourceName ()].Waypoint ), true )
76+ assert .Equal (t , true , isHostnameTypeWaypoint (associated .services [svc3 .ResourceName ()].Waypoint ))
77+ assert .Equal (t , true , isHostnameTypeWaypoint (associated .workloads [wl3 .ResourceName ()].Waypoint ))
7878
7979 // Create waypoint service and process.
8080 waypointsvc := common .CreateFakeService ("waypoint" , "10.240.10.11" , "" , nil )
8181 svcs , wls := cache .Refresh (waypointsvc )
82- assert .Equal (t , len (svcs ), 1 )
83- assert .Equal (t , len (wls ), 1 )
84- assert .Equal (t , associated .isResolved (), true )
85- assert .Equal (t , isHostnameTypeWaypoint (associated .services [svc3 .ResourceName ()].Waypoint ), false )
86- assert .Equal (t , isHostnameTypeWaypoint (associated .workloads [wl3 .ResourceName ()].Waypoint ), false )
82+ assert .Equal (t , 1 , len (svcs ))
83+ assert .Equal (t , 1 , len (wls ))
84+ assert .Equal (t , true , associated .isResolved ())
85+ assert .Equal (t , false , isHostnameTypeWaypoint (associated .services [svc3 .ResourceName ()].Waypoint ))
86+ assert .Equal (t , false , isHostnameTypeWaypoint (associated .workloads [wl3 .ResourceName ()].Waypoint ))
8787
8888 // Create service and workload with waypoint which has been resolved.
8989 svc4 := common .CreateFakeService ("svc4" , "10.240.10.4" , waypointHostname , nil )
@@ -92,8 +92,8 @@ func TestBasic(t *testing.T) {
9292 cache .AddOrUpdateWorkload (wl4 )
9393
9494 // svc4 and wl4 have been added to the waypoint cache and hostname of waypoint has been resolved.
95- assert .Equal (t , isHostnameTypeWaypoint (associated .services [svc4 .ResourceName ()].Waypoint ), false )
96- assert .Equal (t , isHostnameTypeWaypoint (associated .workloads [wl4 .ResourceName ()].Waypoint ), false )
95+ assert .Equal (t , false , isHostnameTypeWaypoint (associated .services [svc4 .ResourceName ()].Waypoint ))
96+ assert .Equal (t , false , isHostnameTypeWaypoint (associated .workloads [wl4 .ResourceName ()].Waypoint ))
9797
9898 // Delete all svcs and workloads.
9999 for _ , svc := range []* workloadapi.Service {svc1 , svc2 , svc3 , svc4 , waypointsvc } {
@@ -103,7 +103,7 @@ func TestBasic(t *testing.T) {
103103 cache .DeleteWorkload (wl .ResourceName ())
104104 }
105105
106- assert .Equal (t , len (cache .serviceToWaypoint ), 0 )
107- assert .Equal (t , len (cache .workloadToWaypoint ), 0 )
108- assert .Equal (t , len (cache .waypointAssociatedObjects ), 0 )
106+ assert .Equal (t , 0 , len (cache .serviceToWaypoint ))
107+ assert .Equal (t , 0 , len (cache .workloadToWaypoint ))
108+ assert .Equal (t , 0 , len (cache .waypointAssociatedObjects ))
109109}
0 commit comments