jeudi 31 mars 2016

Scalatra filter execution after request int test

I faced with the problem that filter executes after controller while writing tests using scalatra-test. Here is the code snippet:

class MyTest extends ScalatraSuite with FunSuiteLike {
    addFilter(calssOf[MyFilter], "/*")
    addServlet(classOf[MyController], "/*")

    test("my test desc") {
        get("/my/path") {
            ...
        }
    }
}

In debug mode I noticed that get("/my/path") method is executed before filter's get("/*") method. This issue occures only when running tests.
Please advice.

Aucun commentaire:

Enregistrer un commentaire