Fix panic in handler test by providing empty config
This commit is contained in:
1 parent
374a3991a2
commit
1e78d01c6b
1 file changed
+11
-3
@@ -5,11 +5,20 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/vault/internalshared/configutil"
|
||||
"github.com/hashicorp/watchtower/internal/cmd/base"
|
||||
"github.com/hashicorp/watchtower/internal/cmd/config"
|
||||
)
|
||||
|
||||
func TestHandleGrpcGateway(t *testing.T) {
|
||||
var c Controller
|
||||
h := c.handler(HandlerProperties{})
|
||||
c := &Controller{
|
||||
conf: &Config{
|
||||
Server: new(base.Server),
|
||||
RawConfig: config.New(),
|
||||
},
|
||||
}
|
||||
h := c.handler(HandlerProperties{ListenerConfig: new(configutil.Listener)})
|
||||
l, err := net.Listen("tcp4", "127.0.0.1:0")
|
||||
if err != nil {
|
||||
t.Fatalf("Couldn't listen: %v", err)
|
||||
@@ -48,4 +57,3 @@ func TestHandleGrpcGateway(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user