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

Function TestRevocationScenario12

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

Source from the content-addressed store, hash-verified

703}
704
705func TestRevocationScenario12(t *testing.T) {
706 defer db.SuspendSequenceBatching()()
707
708 revocationTester, rt := InitScenario(t, nil)
709 defer rt.Close()
710
711 resp := rt.SendAdminRequest("PUT", "/{{.keyspace}}/doc1", `{"channels": "ch1"}`)
712 RequireStatus(t, resp, http.StatusCreated)
713
714 revocationTester.fillToSeq(4)
715 revocationTester.addRoleChannel("foo", "ch1")
716
717 changes := revocationTester.getChanges(5, 0)
718 assert.Equal(t, "5", changes.Last_Seq.String())
719
720 revocationTester.fillToSeq(19)
721 revocationTester.addRole("user", "foo")
722 revocationTester.fillToSeq(44)
723 revocationTester.removeRole("user", "foo")
724 revocationTester.fillToSeq(54)
725 revocationTester.removeRoleChannel("foo", "ch1")
726 revocationTester.fillToSeq(64)
727 revocationTester.addRole("user", "foo")
728 revocationTester.fillToSeq(74)
729 revocationTester.addRoleChannel("foo", "ch1")
730 revocationTester.fillToSeq(84)
731 revocationTester.removeRoleChannel("foo", "ch1")
732
733 revocationTester.fillToSeq(90)
734 changes = revocationTester.getChanges(5, 0)
735 assert.Equal(t, "5", changes.Last_Seq.String())
736
737 revocationTester.fillToSeq(94)
738 revocationTester.removeRole("user", "foo")
739
740 revocationTester.fillToSeq(110)
741 changes = revocationTester.getChanges(90, 0)
742 assert.Equal(t, "90", changes.Last_Seq.String())
743}
744
745func TestRevocationScenario13(t *testing.T) {
746 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