@@ -28,8 +28,7 @@ func TestPrepareHTTPRouteStatus(t *testing.T) {
2828 gwNsName := types.NamespacedName {Namespace : "test" , Name : "gateway" }
2929 gatewayCtlrName := "test.example.com"
3030
31- expectedTime := time .Now ()
32- clock := NewFakeClock (expectedTime )
31+ transitionTime := metav1 .NewTime (time .Now ())
3332
3433 expected := v1alpha2.HTTPRouteStatus {
3534 RouteStatus : v1alpha2.RouteStatus {
@@ -46,7 +45,7 @@ func TestPrepareHTTPRouteStatus(t *testing.T) {
4645 Type : string (v1alpha2 .ConditionRouteAccepted ),
4746 Status : "True" ,
4847 ObservedGeneration : 123 ,
49- LastTransitionTime : metav1. Time { Time : expectedTime } ,
48+ LastTransitionTime : transitionTime ,
5049 Reason : "Attached" ,
5150 },
5251 },
@@ -63,7 +62,7 @@ func TestPrepareHTTPRouteStatus(t *testing.T) {
6362 Type : string (v1alpha2 .ConditionRouteAccepted ),
6463 Status : "False" ,
6564 ObservedGeneration : 123 ,
66- LastTransitionTime : metav1. Time { Time : expectedTime } ,
65+ LastTransitionTime : transitionTime ,
6766 Reason : "Not attached" ,
6867 },
6968 },
@@ -72,7 +71,7 @@ func TestPrepareHTTPRouteStatus(t *testing.T) {
7271 },
7372 }
7473
75- result := prepareHTTPRouteStatus (status , gwNsName , gatewayCtlrName , clock )
74+ result := prepareHTTPRouteStatus (status , gwNsName , gatewayCtlrName , transitionTime )
7675 if diff := cmp .Diff (expected , result ); diff != "" {
7776 t .Errorf ("prepareHTTPRouteStatus() mismatch (-want +got):\n %s" , diff )
7877 }
0 commit comments