config: add Dialer field to ConnectionConfig and PoolConfig with option constructors
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package transport
|
||||
|
||||
import (
|
||||
"git.wisehodl.dev/jay/go-honeybee/honeybeetest"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"net/http"
|
||||
"testing"
|
||||
@@ -253,3 +254,10 @@ func TestValidateConnectionConfig(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestWithConnectionDialer(t *testing.T) {
|
||||
mock := &honeybeetest.MockDialer{}
|
||||
conf, err := NewConnectionConfig(WithConnectionDialer(mock))
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, mock, conf.Dialer)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user