@@ -36,6 +36,7 @@ func TestNewHealthServer(t *testing.T) {
3636 type args struct {
3737 pipeline Pipeline
3838 port string
39+ address string
3940 }
4041 type want struct {
4142 statusCode int
@@ -46,15 +47,15 @@ func TestNewHealthServer(t *testing.T) {
4647 args args
4748 want want
4849 }{
49- {name : "pipeline running" , args : args {pipeline : Pipeline {IsRunning : true }, port : "7000" }, want : want {statusCode : 200 }},
50- {name : "pipeline not running" , args : args {pipeline : Pipeline {IsRunning : false }, port : "7001" }, want : want {statusCode : 503 }},
50+ {name : "pipeline running" , args : args {pipeline : Pipeline {IsRunning : true }, port : "7000" , address : "0.0.0.0" }, want : want {statusCode : 200 }},
51+ {name : "pipeline not running" , args : args {pipeline : Pipeline {IsRunning : false }, port : "7001" , address : "0.0.0.0" }, want : want {statusCode : 503 }},
5152 }
5253
5354 for _ , tt := range tests {
5455 t .Run (tt .name , func (t * testing.T ) {
5556
56- opts := config.Options {Health : config.Health {Port : tt .args .port }}
57- expectedAddr := fmt .Sprintf ("0.0.0.0 :%s" , opts .Health .Port )
57+ opts := config.Options {Health : config.Health {Port : tt .args .port , Address : tt . args . address }}
58+ expectedAddr := fmt .Sprintf ("%s :%s" , opts . Health . Address , opts .Health .Port )
5859 server := operational .NewHealthServer (& opts , tt .args .pipeline .IsAlive , tt .args .pipeline .IsReady )
5960 require .NotNil (t , server )
6061 require .Equal (t , expectedAddr , server .Address )
0 commit comments