ScalaTest 3.0.0 was recently released. Being a major release it brings lots of features, changes (some of them potentially breaking) and new deprecations. In this post I will focus more on the main additions and enhancements, followed by some code examples.
I have been using apacha cassandra/ DSE on a project and it makes sense to leverage the typesafety of scala using the Phantom library which is as they say, "Reactive type-safe Scala DSL for Cassandra". A couple of months ago version v1.19.0 was released which has deprecated the testkit. After updating to new version it has broken all the existing tests in our project. Phantom has good documentation on the wiki pages so I don't think that it is necessary to describe how to use it. But the documentation hasn't been updated recently. So I think it is a good opportunity to describe how to write the tests, as well as showing how to run the test using embedded cassandra.
Welcome to the second article of this series about improving the clarity, quality and reliability of tests in general, and unit tests in particular. In the first article last week we talked about the DRY and DAMP principles. Today we are going to discuss testing a piece of code depending on the configuration and about writing asserts and scenario-style tests.