| 664 | } |
| 665 | |
| 666 | func GetSingleDatabaseCollection(tb testing.TB, database *DatabaseContext) *DatabaseCollection { |
| 667 | require.Equal(tb, 1, len(database.CollectionByID), fmt.Sprintf("Database must only have a single collection configured has %d", len(database.CollectionByID))) |
| 668 | for _, collection := range database.CollectionByID { |
| 669 | return collection |
| 670 | } |
| 671 | tb.Fatalf("Could not find a collection") |
| 672 | return nil |
| 673 | } |
| 674 | |
| 675 | // AllocateTestSequence allocates a sequence via the sequenceAllocator. For use by non-db tests |
| 676 | func AllocateTestSequence(database *DatabaseContext) (uint64, error) { |