converted test from JUnit to Scala Test
properly handle nulls
now returns a future to better manage its asynchronous operation
fixed issue with premature termination of the batch job