@Test
public void testRollbackSetsCheckpointID() throws Exception {

	CompletedCheckpoint savepoint = mock(CompletedCheckpoint.class);
	when(savepoint.getStates()).thenReturn(Collections.<StateForTask>emptyList());
	when(savepoint.getCheckpointID()).thenReturn(12312312L);
	CheckpointIDCounter checkpointIdCounter = mock(CheckpointIDCounter.class);
	StateStore<CompletedCheckpoint> savepointStore = mock(StateStore.class);
	when(savepointStore.getState(anyString())).thenReturn(savepoint);
	SavepointCoordinator coordinator = createSavepointCoordinator(
			new JobID(),
			60 * 1000,
			new ExecutionVertex[] {},
			new ExecutionVertex[] {},
			new ExecutionVertex[] {},
			checkpointIdCounter,
			savepointStore);
	coordinator.restoreSavepoint(createExecutionJobVertexMap(), "any");
	verify(checkpointIdCounter).setCount(eq(12312312L + 1));
	coordinator.shutdown();
}