| 373 | } |
| 374 | |
| 375 | func TestTarget_Write(t1 *testing.T) { |
| 376 | tests := []struct { |
| 377 | name string |
| 378 | fields fields |
| 379 | wantB string |
| 380 | want int |
| 381 | wantErr bool |
| 382 | }{ |
| 383 | // TODO: Add test cases. |
| 384 | } |
| 385 | for _, tt := range tests { |
| 386 | t1.Run(tt.name, func(t1 *testing.T) { |
| 387 | t := &Target{ |
| 388 | Hostname: tt.fields.Hostname, |
| 389 | HostHeader: tt.fields.HostHeader, |
| 390 | muHostHeader: tt.fields.muHostHeader, |
| 391 | IP: tt.fields.IP, |
| 392 | Port: tt.fields.Port, |
| 393 | IsTLS: tt.fields.IsTLS, |
| 394 | BasePath: tt.fields.BasePath, |
| 395 | Headers: tt.fields.Headers, |
| 396 | hits: tt.fields.hits, |
| 397 | quarantineHits: tt.fields.quarantineHits, |
| 398 | quarantined: tt.fields.quarantined, |
| 399 | httpClient: tt.fields.httpClient, |
| 400 | } |
| 401 | b := &bytes.Buffer{} |
| 402 | got, err := t.Write(b) |
| 403 | if (err != nil) != tt.wantErr { |
| 404 | t1.Errorf("Write() error = %v, wantErr %v", err, tt.wantErr) |
| 405 | return |
| 406 | } |
| 407 | if gotB := b.String(); gotB != tt.wantB { |
| 408 | t1.Errorf("Write() gotB = %v, want %v", gotB, tt.wantB) |
| 409 | } |
| 410 | if got != tt.want { |
| 411 | t1.Errorf("Write() got = %v, want %v", got, tt.want) |
| 412 | } |
| 413 | }) |
| 414 | } |
| 415 | } |
| 416 | |
| 417 | func TestTarget_appendColonPort(t1 *testing.T) { |
| 418 | type args struct { |