[SPARK-2024] Refactoring newly added tests