add unit and functional tests for batch