requireDocumentEvents validates that a document CRUD event occurred on the right doc ID with the correct channels.
(rt *RestTester, eventID base.AuditID, output []byte, docID, docVersion string, count int)
| 1551 | |
| 1552 | // requireDocumentEvents validates that a document CRUD event occurred on the right doc ID with the correct channels. |
| 1553 | func requireDocumentEvents(rt *RestTester, eventID base.AuditID, output []byte, docID, docVersion string, count int) { |
| 1554 | events := jsonLines(rt.TB(), output) |
| 1555 | countFound := 0 |
| 1556 | for _, event := range events { |
| 1557 | // skip events that are the target eventID |
| 1558 | if base.AuditID(event[base.AuditFieldID].(float64)) != eventID { |
| 1559 | continue |
| 1560 | } |
| 1561 | require.Equal(rt.TB(), docID, event[base.AuditFieldDocID]) |
| 1562 | require.Equal(rt.TB(), docVersion, event[base.AuditFieldDocVersion].(string)) |
| 1563 | countFound++ |
| 1564 | } |
| 1565 | require.Equal(rt.TB(), count, countFound, "expected exactly %d %s events, got %d", count, base.AuditEvents[eventID].Name, countFound) |
| 1566 | } |
| 1567 | |
| 1568 | // requireChangesStartEvent validates that there is a changes start event with the specified fields |
| 1569 | func requireChangesStartEvent(t testing.TB, output []byte, expectedFields map[string]any) { |
no test coverage detected