(t *testing.T)
| 495 | } |
| 496 | |
| 497 | func TestRevocationScenario7(t *testing.T) { |
| 498 | defer db.SuspendSequenceBatching()() |
| 499 | |
| 500 | revocationTester, rt := InitScenario(t, nil) |
| 501 | defer rt.Close() |
| 502 | |
| 503 | resp := rt.SendAdminRequest("PUT", "/{{.keyspace}}/doc1", `{"channels": "ch1"}`) |
| 504 | RequireStatus(t, resp, http.StatusCreated) |
| 505 | |
| 506 | revocationTester.fillToSeq(4) |
| 507 | revocationTester.addRoleChannel("foo", "ch1") |
| 508 | |
| 509 | changes := revocationTester.getChanges(5, 0) |
| 510 | assert.Equal(t, "5", changes.Last_Seq.String()) |
| 511 | |
| 512 | revocationTester.fillToSeq(19) |
| 513 | revocationTester.addRole("user", "foo") |
| 514 | revocationTester.fillToSeq(25) |
| 515 | |
| 516 | changes = revocationTester.getChanges(5, 1) |
| 517 | assert.Equal(t, "20:3", changes.Last_Seq.String()) |
| 518 | |
| 519 | revocationTester.fillToSeq(44) |
| 520 | revocationTester.removeRole("user", "foo") |
| 521 | revocationTester.fillToSeq(54) |
| 522 | revocationTester.removeRoleChannel("foo", "ch1") |
| 523 | revocationTester.fillToSeq(64) |
| 524 | revocationTester.addRole("user", "foo") |
| 525 | revocationTester.fillToSeq(74) |
| 526 | revocationTester.addRoleChannel("foo", "ch1") |
| 527 | revocationTester.fillToSeq(84) |
| 528 | revocationTester.removeRoleChannel("foo", "ch1") |
| 529 | revocationTester.fillToSeq(94) |
| 530 | revocationTester.removeRole("user", "foo") |
| 531 | |
| 532 | revocationTester.fillToSeq(100) |
| 533 | |
| 534 | changes = revocationTester.getChanges(25, 1) |
| 535 | assert.Equal(t, "45:3", changes.Last_Seq.String()) |
| 536 | assert.True(t, changes.Results[0].Revoked) |
| 537 | |
| 538 | revocationTester.fillToSeq(110) |
| 539 | |
| 540 | changes = revocationTester.getChanges(100, 0) |
| 541 | assert.Equal(t, "100", changes.Last_Seq.String()) |
| 542 | } |
| 543 | |
| 544 | func TestRevocationScenario8(t *testing.T) { |
| 545 | defer db.SuspendSequenceBatching()() |
nothing calls this directly
no test coverage detected