coord.getVersionsBeingServed().put(CoordinationStructures.VERSIONS_BEING_SERVED, versionsBeingServed);
handler.init(config);
List<SwitchVersionRequest> rRequest = new ArrayList<SwitchVersionRequest>();
SwitchVersionRequest theRequest = new SwitchVersionRequest("t1", 3);
rRequest.add(theRequest);
handler.rollback(rRequest);
new TestUtils.NotWaitingForeverCondition() {
@Override
public boolean endCondition() {
return handler.getContext().getCurrentVersionsMap().get("t1") != null &&
handler.getContext().getCurrentVersionsMap().get("t1") == 3l;
}
}.waitAtMost(5000);
assertEquals(3l, (long)coord.getCopyVersionsBeingServed().get("t1"));
/*
* Changing our mind : now back to previous version 4
*/
theRequest = new SwitchVersionRequest("t1", 4);
rRequest = new ArrayList<SwitchVersionRequest>();
rRequest.add(theRequest);
handler.rollback(rRequest);
new TestUtils.NotWaitingForeverCondition() {