Project cannot find withAuthenticator method

I am observing a strange behavior. My project has two test files. In one of the test files, I am able to create a request using withAuthenticator method like the following

val request = FakeRequest("POST", "ws/users/user-signout").withAuthenticator(userTestEnv.testEnv.loginInfo)(userTestEnv.testEnv.fakeEnv)

But in my other test file, I am getting compilation error withAuthenticator is not a method of FakeRequest!

I also noticed that now a new class FakeRequestWithAuthenticator seem to be available in silhouette.

Question 1 - Would you have an idea why my project can’t find withAuthenticator?
Question 2 - Shall I use FakeRequestWithAuthenticator instead of withAuthenticator method?

Hi,

you have to import com.mohiva.play.silhouette.test._ to monkey patch the FakeRequest with FakeRequestWithAuthenticator. FakeRequestWithAuthenticator is an implicit class which adds the withAuthenticator method to a FakeRequest.

Best regards
Christian