MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / TestSetupServerContext

Function TestSetupServerContext

rest/config_test.go:1444–1459  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1442}
1443
1444func TestSetupServerContext(t *testing.T) {
1445 base.SetUpTestLogging(t, base.LevelInfo, base.KeyAll)
1446 t.Run("Create server context with a valid configuration", func(t *testing.T) {
1447 config := DefaultStartupConfig("")
1448 config.Bootstrap.Server = base.UnitTestUrl() // Valid config requires server to be explicitly defined
1449 config.Bootstrap.UseTLSServer = base.Ptr(base.ServerIsTLS(base.UnitTestUrl()))
1450 config.Bootstrap.ServerTLSSkipVerify = base.Ptr(base.TestTLSSkipVerify())
1451 config.Bootstrap.Username = base.TestClusterUsername()
1452 config.Bootstrap.Password = base.TestClusterPassword()
1453 ctx := base.TestCtx(t)
1454 sc, err := SetupServerContext(ctx, &config, false)
1455 require.NoError(t, err)
1456 defer sc.Close(ctx)
1457 require.NotNil(t, sc)
1458 })
1459}
1460
1461// CBG-1583 - config group ID EE-only
1462func TestConfigGroupIDValidation(t *testing.T) {

Callers

nothing calls this directly

Calls 12

SetUpTestLoggingFunction · 0.92
UnitTestUrlFunction · 0.92
PtrFunction · 0.92
ServerIsTLSFunction · 0.92
TestTLSSkipVerifyFunction · 0.92
TestClusterUsernameFunction · 0.92
TestClusterPasswordFunction · 0.92
TestCtxFunction · 0.92
DefaultStartupConfigFunction · 0.85
SetupServerContextFunction · 0.85
RunMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected