Added test for BatchFactory