@Test
public void testJobSucceeded() throws IOException {

    // Test job succeeded
    final SparkListenerJobEnd event = new SparkListenerJobEnd(1, 0, JobSucceeded$.MODULE$);
    final DeletePathsListener function = apply(true, event);
    Assert.assertFalse("Expected file to be deleted", tempFile.exists());
    // Test recreated file is not deleted
    setUp();
    function.apply(event);
    Assert.assertTrue("Expected file to exist", tempFile.exists());
}