spark testing code