Last active
March 30, 2017 09:58
-
-
Save burythehammer/306beeb9138cf5d35a4b861c033dc563 to your computer and use it in GitHub Desktop.
ScalaTest unit test examples for spark and cassandra
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
feature("Calculating current balances") { | |
scenario("Positive transactions") { | |
Given("a cassandra table with only positive transactions") | |
val cassandraRDD = buildMockCassandraRDD(positiveTransactionsFilePath) | |
When("I calculate users' balance") | |
val results = CalculateCurrentBalance.calculateCustomerBalances(cassandraRDD).collect() | |
Then("all balances should be positive") | |
every(results.map { case ((_, _), amount) => amount }) should be > 0 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment