Error when running Scalatra test on Intellij

Asked

Viewed 68 times

1

I’m trying to run the following test of within the :

class Test extends ScalatraFlatSpec with Matchers {
  addServlet(classOf[MainServlet], "/*")

  "Home Page" should "show hello" in {
    get("/"){
      status should equal (200);
    }
  }
}

And the IDE is returning me the following error:

java.lang.Exception: No runnable methods
  at org.junit.internal.runners.MethodValidator.validateInstanceMethods(MethodValidator.java:32)
  at org.junit.internal.runners.MethodValidator.validateMethodsForDefaultRunner(MethodValidator.java:43)
  at org.junit.internal.runners.JUnit4ClassRunner.validate(JUnit4ClassRunner.java:36)
  at org.junit.internal.runners.JUnit4ClassRunner.<init>(JUnit4ClassRunner.java:27)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
  at org.junit.internal.requests.ClassRequest.buildRunner(ClassRequest.java:33)
  at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)
  at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)

1 answer

2

I got this same error when I was running as a test and not as a test of .

Not always the hits the right type of test.

If this is the case to correct change:

Teste do Junit

To:

Teste do ScalaTest

And the test will perform correctly:

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.