RESOLVED - BATCH-1853: If the JobParameters is asked for a Date value that doesn't exist, it will now return null rather than throwing NPE
This commit is contained in:
@@ -191,4 +191,24 @@ public class JobParametersTests {
|
||||
|
||||
assertEquals(params, SerializationUtils.deserialize(serialized));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLongReturns0WhenKeyDoesntExit(){
|
||||
assertEquals(0L,new JobParameters().getLong("keythatdoesntexist"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStringReturnsNullWhenKeyDoesntExit(){
|
||||
assertNull(new JobParameters().getString("keythatdoesntexist"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDoubleReturns0WhenKeyDoesntExit(){
|
||||
assertEquals(0.0,new JobParameters().getLong("keythatdoesntexist"), 0.0001);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDateReturnsNullWhenKeyDoesntExit(){
|
||||
assertNull(new JobParameters().getDate("keythatdoesntexist"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user