How to update from Scala 2.11.12 and Scala-Test 3.0.3?

For more then 5 years I’m stuck at Scala 2.11.12 and Scala-Test 3.0.3. Sometimes I try to update to a newer version but this is always quickly frustrated with “not found” errors. I would like to try again and again all I get is:

[ERROR] …: type FunSuite is not a member of package org.scalatest
[ERROR] …: type Matchers is not a member of package org.scalatest
[ERROR] …: object junit is not a member of package org.scalatest

What happened to

org.scalatest.junit.JUnitRunner
org.scalatest.FunSuite
org.scalatest.Matchers

To clarify: I’m using maven and I expect to just change the version number in the pom.xml file and be done. But this is obviously not the case. What else do I have to do? Or is there no hope to update my tests.


Update 1: If I change to Scala-Test 3.0.3 to Scala-Test 3.1.0 I “only” loose org.scalatest.junit.JUnitRunner.

If you look at the release notes of 3.1.0 you will see that the main change was to split and move the classes to different packages in a preparation for a future release where the library will not longer be bundled together in a single gigantic library but on smaller ones.

Also, if you open the Scaladoc of the version you can search for the classes you want to see what is their new package and name.

1 Like

You can run scalafix on your codebase to automatically rewrite most of these things: https://github.com/scalatest/autofix

2 Likes

Helpful list if only org.scalatest.junit.JUnitRunner wasn’t mentioned. I guess that means using JUnit plugins (Maven, IDEA, etc.) to run Scala-Test isn’t an option any more.

auto-fix — sounds promising only it’s based on sbt and I’m using Maven. I have to see if there is a command line interface.

They seem to have moved to scalatestplus.

Installation · Scalafix and a maven plugin too apparently.

2 Likes