unit testing - Http.Context with FakeApplication and illusive mock method -


In my tests, I am creating a fake application for the exam method:

  @ProfileZero before StartFakeApplication () {this.fakeApplication = FakeApplication (); Start (this.fakeApplication); } Application for killing public zeroes after @ {stop (this.fakeApplication); This.fakeApplication = null; }   

Uses some test functionality that checks whether the request is secure or not:

  is a public boolean () {Http.Request req = Controller. Request (); Return req.getHeader ("X-Forward-Prototo")! = Null & amp; Amp; . Req.getHeader ("X-Forward-Enhanced") includes ("https"); }   

fails to say:

There is no HTTP reference available

from here Very strange, because it's running on a fake app, why not discover it and make a fake request? oh okay, i found this: who introduced me with a funny perspective, so i was eager to go to the same way to code hp.content , problem Is that I can not find the mock method ...

The thread in which it is using static org.mockito.Mockito. * I'm not using this package (where I am assumed as a mock method), only one sub package in org.mockito The name of is internal and I can not find any mock method there.

Documentation of Official Play! The only place to talk about it is to use: import org.specs2.mock ._ but even there I am not able to detect this duplicate method Was there.

I am using 2.2.2 (Java).
Any thoughts? Thank you.

I resolved the same problem by adding my build.sbt Library dependence Mockito:

  libraryDependencies + = "org.mockito"% "mockito-core"% "1.10.19"   

Then I < Code> Fake

and yes <, Fake and Play Eclipse and magically became available after refurbishing the entire project in the Mckitie Library Eclipse .

/ code> is a method org.mockito.Mockito .

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -