GetDatabase Returns a database found for server context, if there is only one database. Fails the test harness if there is not a database defined.
()
| 532 | |
| 533 | // GetDatabase Returns a database found for server context, if there is only one database. Fails the test harness if there is not a database defined. |
| 534 | func (rt *RestTester) GetDatabase() *db.DatabaseContext { |
| 535 | require.Len(rt.TB(), rt.ServerContext().AllDatabases(), 1) |
| 536 | for _, database := range rt.ServerContext().AllDatabases() { |
| 537 | return database |
| 538 | } |
| 539 | return nil |
| 540 | } |
| 541 | |
| 542 | // CreateUser creates a user with the default password and channels scoped to a single test collection. |
| 543 | func (rt *RestTester) CreateUser(username string, channels []string, roles ...string) { |