(t *testing.T)
| 703 | } |
| 704 | |
| 705 | func 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 | |
| 745 | func TestRevocationScenario13(t *testing.T) { |
| 746 | defer db.SuspendSequenceBatching()() |
nothing calls this directly
no test coverage detected