(t *testing.T)
| 448 | } |
| 449 | |
| 450 | func TestRevocationScenario6(t *testing.T) { |
| 451 | defer db.SuspendSequenceBatching()() |
| 452 | |
| 453 | revocationTester, rt := InitScenario(t, nil) |
| 454 | defer rt.Close() |
| 455 | |
| 456 | resp := rt.SendAdminRequest("PUT", "/{{.keyspace}}/doc1", `{"channels": "ch1"}`) |
| 457 | RequireStatus(t, resp, http.StatusCreated) |
| 458 | |
| 459 | revocationTester.fillToSeq(4) |
| 460 | revocationTester.addRoleChannel("foo", "ch1") |
| 461 | |
| 462 | changes := revocationTester.getChanges(5, 0) |
| 463 | assert.Equal(t, "5", changes.Last_Seq.String()) |
| 464 | |
| 465 | revocationTester.fillToSeq(19) |
| 466 | revocationTester.addRole("user", "foo") |
| 467 | revocationTester.fillToSeq(25) |
| 468 | |
| 469 | changes = revocationTester.getChanges(5, 1) |
| 470 | assert.Equal(t, "20:3", changes.Last_Seq.String()) |
| 471 | |
| 472 | revocationTester.fillToSeq(44) |
| 473 | revocationTester.removeRole("user", "foo") |
| 474 | revocationTester.fillToSeq(54) |
| 475 | revocationTester.removeRoleChannel("foo", "ch1") |
| 476 | revocationTester.fillToSeq(64) |
| 477 | revocationTester.addRole("user", "foo") |
| 478 | revocationTester.fillToSeq(74) |
| 479 | revocationTester.addRoleChannel("foo", "ch1") |
| 480 | revocationTester.fillToSeq(84) |
| 481 | revocationTester.removeRoleChannel("foo", "ch1") |
| 482 | |
| 483 | revocationTester.fillToSeq(90) |
| 484 | |
| 485 | changes = revocationTester.getChanges(25, 1) |
| 486 | assert.Equal(t, "55:3", changes.Last_Seq.String()) |
| 487 | assert.True(t, changes.Results[0].Revoked) |
| 488 | |
| 489 | revocationTester.fillToSeq(94) |
| 490 | revocationTester.removeRole("user", "foo") |
| 491 | revocationTester.fillToSeq(110) |
| 492 | |
| 493 | changes = revocationTester.getChanges(90, 0) |
| 494 | assert.Equal(t, "90", changes.Last_Seq.String()) |
| 495 | } |
| 496 | |
| 497 | func TestRevocationScenario7(t *testing.T) { |
| 498 | defer db.SuspendSequenceBatching()() |
nothing calls this directly
no test coverage detected