title: Scala 2.11 -> 2.12 -- Unit test fails in sbt, works in IntelliJ
body: <p>I have a project that has been working under Scala 2.11, and I'm in the process of upgrading it to use Scala 2.12. I've got a unit test that fails when I run it on the command line through sbt, but it works fine when I run it through IntelliJ IDEA.</p>
  
  <p>The error I get is:</p>
  
  <pre><code>java.lang.NoSuchMethodError: scala.Product.$init$(Lscala/Product;)V
  </code></pre>
  
  <p>The test is a JUnit test in Java, and it invokes code written in Scala.</p>
  
  <p>The offending line in the unit test:</p>
  
  <pre><code>String paramsJson = adapter.sendReadyMessage();
  </code></pre>
  
  <p>The <code>sendReadyMessage</code> method (also Java) attempts to create a <code>ReadyMessage</code>:</p>
  
  <pre><code>ReadyMessage rm = new ReadyMessage(timestamp);
  </code></pre>
  
  <p>And a <code>ReadyMessage</code> is just a Scala case class</p>
  
  <pre><code>case class ReadyMessage(Timestamp: String) extends ToJson
  </code></pre>
  
  <p>And <code>ToJson</code> is a lift-JSON helper trait that encapsulates JSON generation:</p>
  
  <pre><code>import net.liftweb.json.{DefaultFormats, Serialization}
  
  trait ToJson {
    private implicit val formats = DefaultFormats
    def toJson = Serialization.write(this)
  }
  </code></pre>
  
  <p>The error appears to happen on the <code>case class ReadyMessage</code> line. The <code>ToJson</code> block is there for context.</p>
  
  <p>Like I said, it works when I run it from within IntelliJ. It fails when I run it under sbt. It fails when it's part of the whole batch of tests in sbt, and it fails when I run it on its own in sbt.</p>
  
  <p>Short of pasting my entire build.sbt file, I'm not sure what other information to include here that might be useful. It seems like it's some kind of version conflict, but I went through and updated all of the software version numbers I can find.</p>
  
  <p>I realize this question covers an issue that may be more complex than can be reasonably debugged over SO. But even a "make sure you've updated XX in your build.sbt" response is helpful.</p>