@@ -500,31 +500,31 @@ func (rr *responseRecorder) WriteHeader(code int) {
500
500
501
501
func TestWrapActivatorHandlerWithFullDuplex (t * testing.T ) {
502
502
logger := ktesting .TestLogger (t )
503
-
503
+
504
504
tests := []struct {
505
- name string
506
- annotation string
507
- expectFullDuplex bool
505
+ name string
506
+ annotation string
507
+ expectFullDuplex bool
508
508
}{
509
509
{
510
- name : "full duplex enabled" ,
511
- annotation : "Enabled" ,
512
- expectFullDuplex : true ,
510
+ name : "full duplex enabled" ,
511
+ annotation : "Enabled" ,
512
+ expectFullDuplex : true ,
513
513
},
514
514
{
515
- name : "full duplex disabled" ,
516
- annotation : "Disabled" ,
517
- expectFullDuplex : false ,
515
+ name : "full duplex disabled" ,
516
+ annotation : "Disabled" ,
517
+ expectFullDuplex : false ,
518
518
},
519
519
{
520
- name : "full duplex missing annotation" ,
521
- annotation : "" ,
522
- expectFullDuplex : false ,
520
+ name : "full duplex missing annotation" ,
521
+ annotation : "" ,
522
+ expectFullDuplex : false ,
523
523
},
524
524
{
525
- name : "full duplex case insensitive" ,
526
- annotation : "enabled" ,
527
- expectFullDuplex : true ,
525
+ name : "full duplex case insensitive" ,
526
+ annotation : "enabled" ,
527
+ expectFullDuplex : true ,
528
528
},
529
529
}
530
530
@@ -535,13 +535,13 @@ func TestWrapActivatorHandlerWithFullDuplex(t *testing.T) {
535
535
// Just respond with OK
536
536
w .WriteHeader (http .StatusOK )
537
537
})
538
-
538
+
539
539
// Wrap with full duplex handler
540
540
wrapped := WrapActivatorHandlerWithFullDuplex (testHandler , logger )
541
-
541
+
542
542
// Create request with context
543
543
req := httptest .NewRequest (http .MethodGet , "/" , nil )
544
-
544
+
545
545
// Set up revision context with annotation
546
546
rev := & v1.Revision {
547
547
ObjectMeta : metav1.ObjectMeta {
@@ -551,14 +551,14 @@ func TestWrapActivatorHandlerWithFullDuplex(t *testing.T) {
551
551
if tt .annotation != "" {
552
552
rev .Annotations [apiconfig .AllowHTTPFullDuplexFeatureKey ] = tt .annotation
553
553
}
554
-
554
+
555
555
ctx := WithRevisionAndID (context .Background (), rev , types.NamespacedName {})
556
556
req = req .WithContext (ctx )
557
-
557
+
558
558
// Execute request
559
559
resp := httptest .NewRecorder ()
560
560
wrapped .ServeHTTP (resp , req )
561
-
561
+
562
562
// Verify response code
563
563
if resp .Code != http .StatusOK {
564
564
t .Errorf ("Expected status %d, got %d" , http .StatusOK , resp .Code )
0 commit comments