@Test
public void testDiscard() throws Exception {

	File file = tmpFolder.newFile();
	assertEquals(true, file.exists());
	OperatorState state = mock(OperatorState.class);
	Map<OperatorID, OperatorState> taskStates = new HashMap<>();
	taskStates.put(new OperatorID(), state);
	// Verify discard call is forwarded to state
	CompletedCheckpoint checkpoint = new CompletedCheckpoint(
			new JobID(), 0, 0, 1,
			taskStates,
			Collections.<MasterState>emptyList(),
			CheckpointProperties.forStandardCheckpoint(),
			new FileStateHandle(new Path(file.toURI()), file.length()),
			file.getAbsolutePath());
	checkpoint.discardOnShutdown(JobStatus.FAILED);
	assertEquals(false, file.exists());
}