Skip to content

Commit d3ba538

Browse files
author
taniwa
committed
add handler_test
Signed-off-by: taniwa <taniwa@yahoo-corp.jp>
1 parent 52ab78d commit d3ba538

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

handler/handler_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,25 @@ func TestNew(t *testing.T) {
534534
return nil
535535
},
536536
},
537+
{
538+
name: "check originlog is used",
539+
args: args{
540+
cfg: config.Proxy{
541+
OriginLog: config.OriginLog{
542+
StatusCode: config.StatusCode{
543+
Enable: true,
544+
Exclude: []int{},
545+
},
546+
},
547+
},
548+
},
549+
checkFunc: func(h http.Handler) error {
550+
if h.(*httputil.ReverseProxy).ModifyResponse == nil {
551+
return errors.Errorf("unexpected ModifyResponse")
552+
}
553+
return nil
554+
},
555+
},
537556
}
538557
for _, tt := range tests {
539558
t.Run(tt.name, func(t *testing.T) {

0 commit comments

Comments
 (0)