From ab1f31e9afbd7bd3f2ad7d95278c53a04aaba2ab Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 16 Sep 2020 09:15:54 -0400 Subject: [PATCH] Add WithDatabaseUrl to testing package --- testing/controller/controller.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/testing/controller/controller.go b/testing/controller/controller.go index de3e73c6de..3e3e7ea3d9 100644 --- a/testing/controller/controller.go +++ b/testing/controller/controller.go @@ -48,6 +48,7 @@ type option struct { setDefaultLoginName bool setDefaultPassword bool setRecoveryKms bool + setDatabaseUrl bool } type Option func(*option) error @@ -137,6 +138,14 @@ func WithRecoveryKms(wrapper wrapping.Wrapper) Option { } } +func WithDatabaseUrl(url string) Option { + return func(c *option) error { + c.setDatabaseUrl = true + c.tcOptions.DatabaseUrl = url + return nil + } +} + // NewTestController blocks until a new TestController is created, returns the url for the TestController and a function // that can be called to tear down the controller after it has been used for testing. func NewTestController(t *testing.T, opt ...Option) *TestController {