@@ -45,7 +45,7 @@ func TestStreamIsActive(t *testing.T) {
4545 setup : func (t * testing.T , qp * queuePinger ) {
4646 namespacedName := & types.NamespacedName {
4747 Namespace : "default" ,
48- Name : t . Name () ,
48+ Name : validHTTPScaledObjectName ,
4949 }
5050 key := namespacedName .String ()
5151
@@ -65,7 +65,7 @@ func TestStreamIsActive(t *testing.T) {
6565 setup : func (t * testing.T , qp * queuePinger ) {
6666 namespacedName := & types.NamespacedName {
6767 Namespace : "default" ,
68- Name : t . Name () ,
68+ Name : validHTTPScaledObjectName ,
6969 }
7070 key := namespacedName .String ()
7171
@@ -88,7 +88,7 @@ func TestStreamIsActive(t *testing.T) {
8888 setup : func (t * testing.T , qp * queuePinger ) {
8989 namespacedName := & types.NamespacedName {
9090 Namespace : "default" ,
91- Name : t . Name () ,
91+ Name : validHTTPScaledObjectName ,
9292 }
9393 key := namespacedName .String ()
9494
@@ -113,7 +113,7 @@ func TestStreamIsActive(t *testing.T) {
113113 setup : func (t * testing.T , qp * queuePinger ) {
114114 namespacedName := & types.NamespacedName {
115115 Namespace : "default" ,
116- Name : t . Name () ,
116+ Name : validHTTPScaledObjectName ,
117117 }
118118 key := namespacedName .String ()
119119
@@ -138,7 +138,7 @@ func TestStreamIsActive(t *testing.T) {
138138 setup : func (t * testing.T , qp * queuePinger ) {
139139 namespacedName := & types.NamespacedName {
140140 Namespace : "default" ,
141- Name : t . Name () ,
141+ Name : validHTTPScaledObjectName ,
142142 }
143143 key := namespacedName .String ()
144144
@@ -163,7 +163,7 @@ func TestStreamIsActive(t *testing.T) {
163163 setup : func (t * testing.T , qp * queuePinger ) {
164164 namespacedName := & types.NamespacedName {
165165 Namespace : "default" ,
166- Name : t . Name () ,
166+ Name : validHTTPScaledObjectName ,
167167 }
168168 key := namespacedName .String ()
169169
@@ -188,7 +188,7 @@ func TestStreamIsActive(t *testing.T) {
188188 setup : func (t * testing.T , qp * queuePinger ) {
189189 namespacedName := & types.NamespacedName {
190190 Namespace : "default" ,
191- Name : t . Name () ,
191+ Name : validHTTPScaledObjectName ,
192192 }
193193 key := namespacedName .String ()
194194
@@ -347,7 +347,7 @@ func TestIsActive(t *testing.T) {
347347 setup : func (t * testing.T , qp * queuePinger ) {
348348 namespacedName := & types.NamespacedName {
349349 Namespace : "default" ,
350- Name : t . Name () ,
350+ Name : validHTTPScaledObjectName ,
351351 }
352352 key := namespacedName .String ()
353353
@@ -369,7 +369,7 @@ func TestIsActive(t *testing.T) {
369369 setup : func (t * testing.T , qp * queuePinger ) {
370370 namespacedName := & types.NamespacedName {
371371 Namespace : "default" ,
372- Name : t . Name () ,
372+ Name : validHTTPScaledObjectName ,
373373 }
374374 key := namespacedName .String ()
375375
@@ -505,7 +505,7 @@ func TestGetMetricSpecTable(t *testing.T) {
505505 r .NotNil (res )
506506 r .Len (res .MetricSpecs , 1 )
507507 spec := res .MetricSpecs [0 ]
508- r .Equal (MetricName (& types.NamespacedName {Namespace : ns , Name : t . Name () }), spec .MetricName )
508+ r .Equal (MetricName (& types.NamespacedName {Namespace : ns , Name : validHTTPScaledObjectName }), spec .MetricName )
509509 r .Equal (int64 (123 ), spec .TargetSize )
510510 },
511511 scalerMetadata : map [string ]string {
@@ -556,7 +556,7 @@ func TestGetMetricSpecTable(t *testing.T) {
556556 r .NotNil (res )
557557 r .Len (res .MetricSpecs , 1 )
558558 spec := res .MetricSpecs [0 ]
559- r .Equal (MetricName (& types.NamespacedName {Namespace : ns , Name : t . Name () }), spec .MetricName )
559+ r .Equal (MetricName (& types.NamespacedName {Namespace : ns , Name : validHTTPScaledObjectName }), spec .MetricName )
560560 r .Equal (int64 (123 ), spec .TargetSize )
561561 },
562562 scalerMetadata : map [string ]string {
@@ -719,9 +719,9 @@ func TestGetMetrics(t *testing.T) {
719719 r := require .New (t )
720720 r .NoError (err )
721721 r .NotNil (res )
722- r .Equal ( 1 , len ( res .MetricValues ) )
722+ r .Len ( res .MetricValues , 1 )
723723 metricVal := res .MetricValues [0 ]
724- r .Equal (MetricName (& types.NamespacedName {Namespace : ns , Name : t . Name () }), metricVal .MetricName )
724+ r .Equal (MetricName (& types.NamespacedName {Namespace : ns , Name : validHTTPScaledObjectName }), metricVal .MetricName )
725725 r .Equal (int64 (0 ), metricVal .MetricValue )
726726 },
727727 defaultTargetMetric : int64 (200 ),
@@ -741,7 +741,7 @@ func TestGetMetrics(t *testing.T) {
741741
742742 namespacedName := & types.NamespacedName {
743743 Namespace : ns ,
744- Name : t . Name () ,
744+ Name : validHTTPScaledObjectName ,
745745 }
746746 key := namespacedName .String ()
747747
@@ -759,9 +759,9 @@ func TestGetMetrics(t *testing.T) {
759759 r := require .New (t )
760760 r .NoError (err )
761761 r .NotNil (res )
762- r .Equal ( 1 , len ( res .MetricValues ) )
762+ r .Len ( res .MetricValues , 1 )
763763 metricVal := res .MetricValues [0 ]
764- r .Equal (MetricName (& types.NamespacedName {Namespace : ns , Name : t . Name () }), metricVal .MetricName )
764+ r .Equal (MetricName (& types.NamespacedName {Namespace : ns , Name : validHTTPScaledObjectName }), metricVal .MetricName )
765765 r .Equal (int64 (201 ), metricVal .MetricValue )
766766 },
767767 defaultTargetMetric : int64 (200 ),
@@ -781,7 +781,7 @@ func TestGetMetrics(t *testing.T) {
781781
782782 namespacedName := & types.NamespacedName {
783783 Namespace : ns ,
784- Name : t . Name () ,
784+ Name : validHTTPScaledObjectName ,
785785 }
786786 key := namespacedName .String ()
787787
@@ -799,9 +799,9 @@ func TestGetMetrics(t *testing.T) {
799799 r := require .New (t )
800800 r .NoError (err )
801801 r .NotNil (res )
802- r .Equal ( 1 , len ( res .MetricValues ) )
802+ r .Len ( res .MetricValues , 1 )
803803 metricVal := res .MetricValues [0 ]
804- r .Equal (MetricName (& types.NamespacedName {Namespace : ns , Name : t . Name () }), metricVal .MetricName )
804+ r .Equal (MetricName (& types.NamespacedName {Namespace : ns , Name : validHTTPScaledObjectName }), metricVal .MetricName )
805805 // the value here needs to be the same thing as
806806 // the sum of the values in the fake queue created
807807 // in the setup function
@@ -839,7 +839,7 @@ func TestGetMetrics(t *testing.T) {
839839 r := require .New (t )
840840 r .NoError (err )
841841 r .NotNil (res )
842- r .Equal ( 1 , len ( res .MetricValues ) )
842+ r .Len ( res .MetricValues , 1 )
843843 metricVal := res .MetricValues [0 ]
844844 r .Equal (MetricName (& types.NamespacedName {Namespace : ns , Name : t .Name ()}), metricVal .MetricName )
845845 // the value here needs to be the same thing as
0 commit comments