@Test
public void testResetState() throws Exception {
// have tx in progress, committing and committed then reset,
// get the last snapshot and see that it is empty
TransactionSystemClient client = getClient();
TransactionStateStorage stateStorage = getStateStorage();
Transaction tx1 = client.startShort();
Transaction tx2 = client.startShort();
client.canCommit(tx1, asList(C1, C2));
client.commit(tx1);
client.canCommit(tx2, asList(C3, C4));
Transaction txPreReset = client.startShort();
long currentTs = System.currentTimeMillis();
client.resetState();
TransactionSnapshot snapshot = stateStorage.getLatestSnapshot();
Assert.assertTrue(snapshot.getTimestamp() >= currentTs);
Assert.assertEquals(0, snapshot.getInvalid().size());
Assert.assertEquals(0, snapshot.getInProgress().size());
Assert.assertEquals(0, snapshot.getCommittingChangeSets().size());
Assert.assertEquals(0, snapshot.getCommittedChangeSets().size());