Coder Social home page Coder Social logo

Comments (3)

maxant avatar maxant commented on May 9, 2024

Zip file containing project is at: https://github.com/maxant/share/blob/master/playframework_Play20_issues_857.zip?raw=true

from playframework.

jroper avatar jroper commented on May 9, 2024
  1. play.api.test.WithApplication is for use with Specs, not JUnit. Either write your tests using specs and WithApplication, or if you must use JUnit, then make ApplicationTest extend play.test.WithApplication, and call start() in an @Before method. Failure to do so will cause all sorts of strange unexpected behaviour.
  2. You are invoking the action directly. The action returns an iteratee, and this iteratee must be fed the body, but you are feeding nothing into it, because you call the run method on it. This is why the body is not passed. Instead, use play.api.test.Helpers.route, this will feed the body you supplied to withFormUrlEncodedBody into the iteratee for you.
  3. If you have any further issues, please post them to the mailing list. The mailing list is the place to ask questions and get help, the issue tracker is for raising confirmed bugs.

from playframework.

maxant avatar maxant commented on May 9, 2024

In case anyone ever reads this in the future, I've posted a question to https://groups.google.com/forum/?fromgroups=#!topic/play-framework/L6KhSL3WM7U . I explicitly said I want to stub the dependencies in the controller and that is why I don't want to use the route function. The code doesn't use a dependency injection framework which I could configure to inject stubbed dependencies.

from playframework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.