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

Function TestRevocationScenario10

rest/revocation_test.go:624–662  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

622}
623
624func TestRevocationScenario10(t *testing.T) {
625 defer db.SuspendSequenceBatching()()
626
627 revocationTester, rt := InitScenario(t, nil)
628 defer rt.Close()
629
630 resp := rt.SendAdminRequest("PUT", "/{{.keyspace}}/doc1", `{"channels": "ch1"}`)
631 RequireStatus(t, resp, http.StatusCreated)
632
633 revocationTester.fillToSeq(4)
634 revocationTester.addRoleChannel("foo", "ch1")
635
636 changes := revocationTester.getChanges(5, 0)
637 assert.Equal(t, "5", changes.Last_Seq.String())
638
639 revocationTester.fillToSeq(19)
640 revocationTester.addRole("user", "foo")
641 revocationTester.fillToSeq(44)
642 revocationTester.removeRole("user", "foo")
643 revocationTester.fillToSeq(54)
644 revocationTester.removeRoleChannel("foo", "ch1")
645 revocationTester.fillToSeq(64)
646 revocationTester.addRole("user", "foo")
647
648 revocationTester.fillToSeq(70)
649 changes = revocationTester.getChanges(5, 0)
650 assert.Equal(t, "5", changes.Last_Seq.String())
651
652 revocationTester.fillToSeq(74)
653 revocationTester.addRoleChannel("foo", "ch1")
654 revocationTester.fillToSeq(84)
655 revocationTester.removeRoleChannel("foo", "ch1")
656 revocationTester.fillToSeq(94)
657 revocationTester.removeRole("user", "foo")
658
659 revocationTester.fillToSeq(110)
660 changes = revocationTester.getChanges(70, 0)
661 assert.Equal(t, "70", changes.Last_Seq.String())
662}
663
664func TestRevocationScenario11(t *testing.T) {
665 defer db.SuspendSequenceBatching()()

Callers

nothing calls this directly

Calls 13

SuspendSequenceBatchingFunction · 0.92
InitScenarioFunction · 0.85
RequireStatusFunction · 0.85
SendAdminRequestMethod · 0.80
fillToSeqMethod · 0.80
addRoleChannelMethod · 0.80
getChangesMethod · 0.80
CloseMethod · 0.65
StringMethod · 0.65
EqualMethod · 0.45
addRoleMethod · 0.45
removeRoleMethod · 0.45

Tested by

no test coverage detected