newRestTester creates the underlying rest testers, use public functions.
(tb testing.TB, restConfig *RestTesterConfig, collectionConfig collectionConfiguration, numCollections int)
| 166 | |
| 167 | // newRestTester creates the underlying rest testers, use public functions. |
| 168 | func newRestTester(tb testing.TB, restConfig *RestTesterConfig, collectionConfig collectionConfiguration, numCollections int) *RestTester { |
| 169 | var rt RestTester |
| 170 | if tb == nil { |
| 171 | panic("tester parameter cannot be nil") |
| 172 | } |
| 173 | rt.testingTB.Store(&tb) |
| 174 | if restConfig != nil { |
| 175 | rt.RestTesterConfig = restConfig |
| 176 | } else { |
| 177 | rt.RestTesterConfig = &RestTesterConfig{} |
| 178 | } |
| 179 | rt.RestTesterConfig.collectionConfig = collectionConfig |
| 180 | rt.RestTesterConfig.numCollections = numCollections |
| 181 | rt.RestTesterConfig.useTLSServer = base.ServerIsTLS(base.UnitTestUrl()) |
| 182 | return &rt |
| 183 | } |
| 184 | |
| 185 | // NewRestTester returns a rest tester backed by a single database and a single default collection. |
| 186 | func NewRestTesterDefaultCollection(tb testing.TB, restConfig *RestTesterConfig) *RestTester { |
no test coverage detected