title: How to pass Configuration object to controller in unit test
body: <p>I have a controller as follows:</p>
  
  <pre class="lang-scala prettyprint-override"><code>class MyController @Inject()
  (
    cc : ControllerComponents,
  ) extends AbstractController(cc) with I18Support(
  
    def controllerMethod() = Action{
     ... //some impl.
    }
  )
  </code></pre>
  
  <p>I am testing my controller in my Scalatest as follows:</p>
  
  <pre class="lang-scala prettyprint-override"><code>"My Controller" when {
  
    "a user hits this controller method" should {
  
    val controller = new MyController( cc = stubMessageControllerComponents )
  
    "be a 200 OK" in {
      whenReady(controller.mycontrollerMethod().apply(FakeRequest("GET", "/"))) {
      // some test
  
     }
  </code></pre>
  
  <p>My issue is that now I have changed the controller class to inject a configuration object as follows</p>
  
  <pre class="lang-scala prettyprint-override"><code>class MyController @Inject()
  (
    config : Configuration,
    cc : ControllerComponents,
  ) extends AbstractController(cc) with I18Support(
  
    def controllerMethod() = Action{
     ... //some impl.
    }
  )
  </code></pre>
  
  <p>I now get a compile error in my test because I am not passing in a Configuration object. How can I do that?</p>
  
  <pre class="lang-scala prettyprint-override"><code>"My Controller" when {
  
    "a user hits this controller method" should {
  
    val controller = new MyController(
      // &lt;- how can I pass a configuration object here 
      cc = stubMessageControllerComponents 
    )
  
    "be a 200 OK" in {
      whenReady(controller.mycontrollerMethod().apply(FakeRequest("GET", "/"))) {
      // some test
  
     }
  </code></pre>