Silhouette controller - pure unit testing


#1

Hi,

I would like to write pure unit tests of my controllers (without running application, and with constructor parameters provided directly, instead of DI - like described here: https://www.playframework.com/documentation/2.6.x/ScalaTestingWithScalaTest#Unit-Testing-Controllers).
But I don’t know, how to construct Silhouette[MyEnv], which I have to pass to constructor. I’ve created FakeEnvironment, but it’s only instance of Environment[MyEnv], not Silhouette[MyEnv].
Could someone help me?


#2

Please read: NullPointerExcection when mocking Silhouette in Mockito


#3

Thank You. I’ll probably need to prepare test helper with all mocks.