(t *testing.T)
| 662 | } |
| 663 | |
| 664 | func TestRevocationScenario11(t *testing.T) { |
| 665 | defer db.SuspendSequenceBatching()() |
| 666 | |
| 667 | revocationTester, rt := InitScenario(t, nil) |
| 668 | defer rt.Close() |
| 669 | |
| 670 | resp := rt.SendAdminRequest("PUT", "/{{.keyspace}}/doc1", `{"channels": "ch1"}`) |
| 671 | RequireStatus(t, resp, http.StatusCreated) |
| 672 | |
| 673 | revocationTester.fillToSeq(4) |
| 674 | revocationTester.addRoleChannel("foo", "ch1") |
| 675 | |
| 676 | changes := revocationTester.getChanges(5, 0) |
| 677 | assert.Equal(t, "5", changes.Last_Seq.String()) |
| 678 | |
| 679 | revocationTester.fillToSeq(19) |
| 680 | revocationTester.addRole("user", "foo") |
| 681 | revocationTester.fillToSeq(44) |
| 682 | revocationTester.removeRole("user", "foo") |
| 683 | revocationTester.fillToSeq(54) |
| 684 | revocationTester.removeRoleChannel("foo", "ch1") |
| 685 | revocationTester.fillToSeq(64) |
| 686 | revocationTester.addRole("user", "foo") |
| 687 | revocationTester.fillToSeq(74) |
| 688 | revocationTester.addRoleChannel("foo", "ch1") |
| 689 | |
| 690 | revocationTester.fillToSeq(80) |
| 691 | changes = revocationTester.getChanges(5, 1) |
| 692 | assert.Equal(t, "75:3", changes.Last_Seq.String()) |
| 693 | |
| 694 | revocationTester.fillToSeq(84) |
| 695 | revocationTester.removeRoleChannel("foo", "ch1") |
| 696 | revocationTester.fillToSeq(94) |
| 697 | revocationTester.removeRole("user", "foo") |
| 698 | |
| 699 | revocationTester.fillToSeq(110) |
| 700 | changes = revocationTester.getChanges(80, 1) |
| 701 | assert.Equal(t, "85:3", changes.Last_Seq.String()) |
| 702 | assert.True(t, changes.Results[0].Revoked) |
| 703 | } |
| 704 | |
| 705 | func TestRevocationScenario12(t *testing.T) { |
| 706 | defer db.SuspendSequenceBatching()() |
nothing calls this directly
no test coverage detected