Running your first test with Play framework you could face an issue related to the missing Junit libraries, in particular:
[error] package org.junit does not exist;
Despite your test case is compiled from Eclipse JVM without any warning or error (since Eclipse has in its classpath Junit), at the test execution time, more exactly when you run the command test in the play console, you face the library missing issue:
play! 2.1.0 (using Java 1.6.0_43 and Scala 2.10.0), http://www.playframework.org > Type "help play" or "license" for more information. > Type "exit" or use Ctrl+D to leave this console. [myapp] $ test [info] Compiling 1 Scala source and 4 Java sources to /myapp/target/scala-2.10/classes... [error] /myapp/app/models/ModelsTest.java:4: package org.junit does not exist [error] import org.junit.*; [error] ^ [error] /myapp/app/models/ModelsTest.java:5: package org.junit does not exist [error] import static org.junit.Assert.*; [error] ^ [error] /myapp/app/models/ModelsTest.java:6: package play.test does not exist [error] import play.test.WithApplication; [error] ^ [error] /myapp/app/models/ModelsTest.java:7: package play.test does not exist [error] import static play.test.Helpers.*; [error] ^
That's could happen cause the unit test case class could have been created under the source app folder. It has to be created under the source folder test. It's pretty intuitive but sometimes we could miss it :-)
This time the test will not fail.