(t *testing.T)
| 542 | } |
| 543 | |
| 544 | func TestRevocationScenario8(t *testing.T) { |
| 545 | defer db.SuspendSequenceBatching()() |
| 546 | |
| 547 | revocationTester, rt := InitScenario(t, nil) |
| 548 | defer rt.Close() |
| 549 | |
| 550 | resp := rt.SendAdminRequest("PUT", "/{{.keyspace}}/doc1", `{"channels": "ch1"}`) |
| 551 | RequireStatus(t, resp, http.StatusCreated) |
| 552 | |
| 553 | revocationTester.fillToSeq(4) |
| 554 | revocationTester.addRoleChannel("foo", "ch1") |
| 555 | |
| 556 | changes := revocationTester.getChanges(5, 0) |
| 557 | assert.Equal(t, "5", changes.Last_Seq.String()) |
| 558 | |
| 559 | revocationTester.fillToSeq(19) |
| 560 | revocationTester.addRole("user", "foo") |
| 561 | revocationTester.fillToSeq(44) |
| 562 | revocationTester.removeRole("user", "foo") |
| 563 | |
| 564 | revocationTester.fillToSeq(50) |
| 565 | changes = revocationTester.getChanges(5, 0) |
| 566 | assert.Equal(t, "5", changes.Last_Seq.String()) |
| 567 | |
| 568 | revocationTester.fillToSeq(54) |
| 569 | revocationTester.removeRoleChannel("foo", "ch1") |
| 570 | revocationTester.fillToSeq(64) |
| 571 | revocationTester.addRole("user", "foo") |
| 572 | revocationTester.fillToSeq(74) |
| 573 | revocationTester.addRoleChannel("foo", "ch1") |
| 574 | revocationTester.fillToSeq(84) |
| 575 | revocationTester.removeRoleChannel("foo", "ch1") |
| 576 | revocationTester.fillToSeq(94) |
| 577 | revocationTester.removeRole("user", "foo") |
| 578 | |
| 579 | revocationTester.fillToSeq(110) |
| 580 | changes = revocationTester.getChanges(50, 0) |
| 581 | assert.Equal(t, "50", changes.Last_Seq.String()) |
| 582 | } |
| 583 | |
| 584 | func TestRevocationScenario9(t *testing.T) { |
| 585 | defer db.SuspendSequenceBatching()() |
nothing calls this directly
no test coverage detected