When I execute sbt test
in order to test a spark application utilizing spark-testing-base
Map("result" -> Array(3, 6, 9, 12, 15, 18, 21, 24, 27, 0)) did not equal Map("result" -> Array(3, 6, 9, 12, 15, 18, 21, 24, 27, 0))
for a test case of
val input: Map[String, Any] = Map("digits" -> Seq(1, 2, 3, 4, 5, 6, 7, 8, 9, 0))
val expectedOutput: Map[String, Any] = Map("result" -> Array(3, 6, 9, 12, 15, 18, 21, 24, 27, 0))
val result = SimpleContext.runTheJOb(session, input)
Minimal example can be found https://github.com/geoHeil/apache-spark-restAPI-example
edit
the whole test case directly
class SimpleTest extends FunSuite with SharedSparkContext with DatasetSuiteBase {
test("SimpleContext should multiply input numbers by 3") {
val session = spark
val input: Map[String, Any] = Map("digits" -> Seq(1, 2, 3, 4, 5, 6, 7, 8, 9, 0))
val expectedOutput: Map[String, Any] = Map("result" -> Array(3, 6, 9, 12, 15, 18, 21, 24, 27, 0))
val result = SimpleContext.runTheJOb(session, input)
assert(expectedOutput === result)
}
}