requireCurrentVersion fetches the document by key, and validates that cv matches.
(t *testing.T, key string, source string, version uint64)
| 835 | |
| 836 | // requireCurrentVersion fetches the document by key, and validates that cv matches. |
| 837 | func (c *DatabaseCollection) RequireCurrentVersion(t *testing.T, key string, source string, version uint64) { |
| 838 | ctx := base.TestCtx(t) |
| 839 | doc, err := c.GetDocument(ctx, key, DocUnmarshalSync) |
| 840 | require.NoError(t, err) |
| 841 | if doc.HLV == nil { |
| 842 | require.Equal(t, "", source) |
| 843 | require.Equal(t, "", version) |
| 844 | return |
| 845 | } |
| 846 | |
| 847 | require.Equal(t, doc.HLV.SourceID, source) |
| 848 | require.Equal(t, doc.HLV.Version, version) |
| 849 | } |
| 850 | |
| 851 | // GetDocumentCurrentVersion fetches the document by key and returns the current version |
| 852 | func (c *DatabaseCollection) GetDocumentCurrentVersion(t testing.TB, key string) (source string, version uint64) { |